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.

6 days ago in Big Data Hadoop by Brian
10 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 6 days ago 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
• 19,720 points
19 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,120 points
347 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,120 points
721 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,110 points
2,047 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,110 points
196 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,476 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
764 views
0 votes
1 answer

Hive Query to sort data

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

answered 6 days ago in Big Data Hadoop by Tina
8 views