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
226 views

1 answer to this question.

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
• 67,480 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
• 67,480 points
171 views
0 votes
1 answer

Getting error while using sqoop import.

You are trying to execute the sqoop ...READ MORE

answered Jul 5 in Big Data Hadoop by Reshma
46 views
0 votes
1 answer

Sqoop import error with sqoop job

Please try the below command: sqoop job -create ...READ MORE

answered Jul 9 in Big Data Hadoop by Rina
35 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
• 10,670 points
2,736 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,670 points
289 views
0 votes
10 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
13,563 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,240 points
993 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
• 67,480 points
212 views
0 votes
1 answer