Data import using sqoop to Hive

0 votes

Hello Everyone,

I am trying to import data using sqoop to Hive, but I am getting following error.



ERROR manager.SqlManager: Error executing statement: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that correspond

s to your MySQL server version for the right syntax to use near 'where (1 = 0)' at line 1

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where

(1 = 0)' at line 1

Code :



sqoop import --connect jdbc:mysql://ip-10-0-1-10.ec2.internal/BDHS_PROJECT --username labuser --password 'edureka' --query ' select date_

format(sp.Trading_date,'yyyy') AS Trading_year, date_format(sp.Trading_date,'MM') AS Trading_month, sp.Symbol, sc.Company_name as CompanyName, sc.Headquarter as State, sc.Sect

or as Sector, sc.Sub_industry as Sub_Industry, AVG(sp.Open) as Open, AVG(sp.Close) as Close, AVG(sp.Low) as Low, AVG(sp.High) as High, AVG(sp.Volume) as Volume from STOCK_PRIC

ES sp left join STOCK_COMPANIES sc on sp.Symbol = sc.Symbol group by Trading_year, Trading_month, CompanyName where $CONDITIONS' --hive-import  --hive-table BDHS_PROJECT.stock -m 1;

Jul 3, 2020 in Big Data Hadoop by anonymous
• 120 points
1,081 views

Hi, @Ketulkumar,

Could you please show me how did you establish the connection with the database!

The error that you are getting indicates that the Connection is not established with the Oracle Database. Most likely it due to either the Database hostname is not resolvable from your machine where you are running the sqoop client Or the --connect URL is not in a correct format. Please remove the '//' from the connection url string.

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Big Data Hadoop

0 votes
1 answer

How to fetch more data from database while using Sqoop import?

Hey. You guessed it right. The max ...READ MORE

answered May 15, 2019 in Big Data Hadoop by Gani
2,603 views
0 votes
1 answer

How to transfer data from Netezza to HDFS using Apache Sqoop?

Remove the --direct option. It gives issue ...READ MORE

answered Apr 23, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
1,773 views
0 votes
1 answer

Hadoop Hive Hbase: How to insert data into Hbase using Hive (JSON file)?

You can use the get_json_object function to parse the ...READ MORE

answered Nov 15, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,948 views
0 votes
1 answer

How to securely transfer data from rdms to hdfs using sqoop?

Sqoop stores metadata in a repository and ...READ MORE

answered Dec 18, 2018 in Big Data Hadoop by Omkar
• 69,220 points
1,402 views
0 votes
1 answer

Unable to run import script using sqoop

You are writing incorrect command. Please write ...READ MORE

answered Mar 8, 2019 in Big Data Hadoop by Raj
782 views
0 votes
0 answers

How to import Flat files in Hadoop using sqoop?

It is possible to import data between ...READ MORE

Apr 9, 2019 in Big Data Hadoop by Gitika
• 65,770 points
860 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,077 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,575 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,073 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,642 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