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, 2019 in Big Data Hadoop by Ismal
878 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, 2019 by Omkar
• 69,110 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
• 69,110 points
473 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,110 points
1,575 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,110 points
472 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
7,106 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
1,141 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
51,440 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,390 points
2,685 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,110 points
812 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,110 points
258 views