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 30 in Big Data Hadoop by Ismal
45 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 30 by Omkar
• 65,840 points

Related Questions In Big Data Hadoop

0 votes
1 answer
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
• 65,840 points
86 views
0 votes
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
• 65,840 points
43 views
0 votes
1 answer

Sqoop creating new file for import evertime

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

answered Jan 8 in Big Data Hadoop by Omkar
• 65,840 points
19 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
• 9,030 points
1,645 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
• 9,030 points
130 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
7,977 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,260 points
555 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
• 65,840 points
113 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
• 65,840 points
56 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.