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
1,144 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,170 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,170 points
1,160 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,170 points
546 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,170 points
1,721 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,170 points
599 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
8,185 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,411 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
69,578 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
3,122 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,170 points
1,036 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,170 points
308 views