Creating a hive script and execute in the edureka cloudlab.

0 votes

I would like to create a hive script and execute in the edureka cloudlab. I created a notepad file with .sql extension(txns.sql) and placed following queries in it. 

create table txnrecords1(txnno INT, txndate STRING, custno INT, amount DOUBLE, category STRING, prodcut STRING, city STRING, state STRING, spendby STRING) row
format delimited fields terminated by , stored as TEXTFILE;

load data inpath hdfs://nameservice1/user/edureka_142337/txns1.txt overwrite into table txnrecords1;

I placed the txns.sql file in following location

/mnt/home/edureka_142337/txns.sql

Next on hive shell, I have executed the following command

hive -f /mnt/home/edureka_142337/txns.sql;

After command execution, I am receiving an error. Not sure whats wrong with the above process.

Jul 14 in Big Data Hadoop by Brian
19 views

1 answer to this question.

0 votes

Please remove -f option from hive arguments and use hql extension instead of sql for the txns file. This should work. 

answered Jul 14 by Karan

Related Questions In Big Data Hadoop

0 votes
1 answer

When creating a Hive table how can you specify the table creator name in Hive?

Hey, While creating a table the TBLPROPERTIES clause is used ...READ MORE

answered Jun 26 in Big Data Hadoop by Gitika
• 25,340 points
33 views
0 votes
1 answer
0 votes
1 answer

How to limit the number of rows per each item in a Hive QL?

SELECT a_id, b, c, count(*) as sumrequests FROM ...READ MORE

answered Nov 30, 2018 in Big Data Hadoop by Omkar
• 67,480 points
940 views
0 votes
1 answer

How to create a parquet table in hive and store data in it from a hive table?

Please use the code attached below for ...READ MORE

answered Jan 28 in Big Data Hadoop by Omkar
• 67,480 points
1,707 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,670 points
2,736 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,670 points
289 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
13,556 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
992 views
0 votes
1 answer

Hive Query to sort data

If you are trying to sort first ...READ MORE

answered Jul 14 in Big Data Hadoop by Tina
20 views