- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Sqoop Export Error - Need Help
- Labels:
-
Apache Hadoop
-
Apache Hive
-
Apache Sqoop
Created ‎03-09-2018 11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
Thanking you
Santanu
Created ‎03-09-2018 02:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎03-09-2018 02:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎03-10-2018 06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
