Sqoop import: import failed error

0 votes

When I run this command:

sqoop import --connect jdbc:mysql://mysqldb.edu.cloudlab.com/retail_db --username labuser --password edureka --table customers --hbase-table hbaseimpo
rt111 --hbase-row-key customer_id --columns "customer_fname,customer_lname" --column-family cf1 --hbase-create-table -m 1;

I am getting import failed error.

Feb 11 in Big Data Hadoop by Likhita
68 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 problem which you are facing is because of the schema of your MySql table. In your import command, you can select a subset of columns and control their ordering by using the --columns argument. This should include a comma-delimited list of columns to export. For example: --columns "col1,col2,col3". 

Note that columns that are not included in the --columns parameter need to have either defined default value or allow NULL values. Otherwise, your database will reject the imported data which in turn will make Sqoop job fail.

Please either use all the column names in the --columns tab of your Sqoop command as given in the below image or In MySql create a table with the proper schema where columns of your MySql table should allow null values.

Refer to the below screenshot where we have executed the Sqoop command successfully.

image

image

answered Feb 11 by Omkar
• 65,850 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Sqoop import failed while importing mysql table to Hbase

There is a spelling mistake in your ...READ MORE

answered Feb 6 in Big Data Hadoop by Omkar
• 65,850 points
69 views
0 votes
1 answer
0 votes
1 answer

Apache Spark gives "Failed to load native-hadoop with error"

Seems like hadoop path is missing in java.library.path. ...READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 65,850 points
179 views
0 votes
1 answer
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,070 points
1,679 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,070 points
132 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
8,160 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
572 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,850 points
118 views
0 votes
1 answer

© 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.