Sqoop import where clause problem

0 votes
sqoop import --connect jdbc:mysql://localhost:3306/hadoop --table employee --username hduser --password password --where "employee=specialty" -target-dir "/user/hadoop/InstaCard/cheeses/";

I am getting error:

18/11/28 12:44:25 ERROR tool.ImportTool: Import failed: java.io.IOException:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an err
or in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "specialty )" at line 1.
Jan 31, 2019 in Big Data Hadoop by Ismal
2,093 views

1 answer to this question.

0 votes

The syntax you are using is wrong. The right syntax to use WHERE clause is as follows:

sqoop import --connect jdbc:mysql://localhost:3306/hadoop --query "select * where $CONDITION" --target-dir "/user/hadoop/InstaCard/cheeses/" --username hduser --password password --where "employee=specialty" 
answered Jan 31, 2019 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Sqoop import gives error: org.apache.hadoop.security.AccessControlException: Permission denied

Seems like you are not passing the ...READ MORE

answered Dec 17, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,099 views
0 votes
1 answer

Sqoop import not working

The error you are getting is because ...READ MORE

answered Dec 18, 2018 in Big Data Hadoop by Omkar
• 69,220 points
973 views
–1 vote
1 answer

Sqoop split-by problem

Hello. The -m or --num-mappers is just a ...READ MORE

answered Dec 19, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,386 views
0 votes
1 answer

Sqoop creating new file for import evertime

No, you are not doing anything wrong ...READ MORE

answered Jan 8, 2019 in Big Data Hadoop by Omkar
• 69,220 points
1,181 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,072 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,571 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,055 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,639 views
0 votes
1 answer

Hadoop sqoop import not working. Error: ERROR manager.SqlManager: Error reading from database

In the command, try mentioning the driver ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,169 views
0 votes
1 answer

How to use sqoop import?

Here is an example of import command. ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 69,220 points
864 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