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
86 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 30 by Omkar
• 68,480 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
• 68,480 points
193 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
• 68,480 points
530 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
• 68,480 points
130 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,800 points
3,583 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,800 points
457 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
18,462 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,280 points
1,335 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
• 68,480 points
290 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
• 68,480 points
107 views