Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Sqoop Export Error - Need Help

avatar
Contributor

Hi Friends,

I need one help.

I am trying to export data from HDFS to MySQL using Sqoop Export and staging table in MySQL. But it is failing and I am not able to understand the reason. I have attached the script I am executing. Please help me to resolve the error and kindly explain what did I do wrong ?

problem-1.txt

Thanking you

Santanu

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@Santanu Ghosh

During Sqoop export, Staging table should be identical in structure to the destination table. I see in your tables datatype of third column is different.

Can you update and then try.

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

@Santanu Ghosh

During Sqoop export, Staging table should be identical in structure to the destination table. I see in your tables datatype of third column is different.

Can you update and then try.

avatar
Contributor

Thanks @rtrivedi for your help and response. It is now resolved. Also,

I made a small modification to my sqoop code.

I changed --input-null-string '\\N' instead of --input-null-string 'Unknown' (used previously).

I am mentioning the entire sqoop code.

sqoop export --connect jdbc:mysql://localhost:3306/my_db --username root --password-file /user/cloudera/textdata/sq_pwd_1.txt \ --export-dir /user/cloudera/hivedata/employee --table employee --staging-table employee_stg --clear-staging-table \ --input-null-string '\\N' --input-null-non-string '\\N' --input-fields-terminated-by "," --input-lines-terminated-by "\n" -m 1

Thanking you

Santanu