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, 2019 in Big Data Hadoop by Brian
758 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, 2019 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, 2019 in Big Data Hadoop by Gitika
• 65,770 points
1,252 views
0 votes
0 answers

What is the difference between partitioning and bucketing a table in Hive ?

Hi Team, I am new to Hive. I ...READ MORE

Dec 20, 2020 in Big Data Hadoop by akhtar
• 38,260 points
1,553 views
0 votes
1 answer
+1 vote
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 Dec 1, 2018 in Big Data Hadoop by Omkar
• 69,220 points
27,088 views
+1 vote
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
• 11,380 points
11,076 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
• 11,380 points
2,574 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,071 views
–1 vote
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,350 points
4,641 views
0 votes
1 answer

Hive Query to sort data

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

answered Jul 14, 2019 in Big Data Hadoop by Tina
919 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP