I have file like this:
1^%~binod^*~1^%~ritesh^*~1^%~shisir^*~1^%~budhdha^*~1^%~romika^*~1^%~rubeena^*~
Where --input-fields-terminated-by '^%~' --input-lines-terminated-by '^*~'.
I tried to export via command:
sqoop export --connect jdbc:mysql://localhost/sqoop --username root -P --table makalu --export-dir sqoop/makalu --input-fields-terminated-by '^%~' --input-lines-terminated-by '^*~'
But it writes a single line of:
id|name 1|%~binod
in MySQL.
arguments --input-fields-terminated-by and --input-lines-terminated-by accepts single character
when you execute your export command in terminal you can see below warnings
02/03 18:55:21 WARN sqoop.SqoopOptions: Character argument ^%~ has multiple characters; only the first will be used.
15/02/03 18:55:21 WARN sqoop.SqoopOptions: Character argument ^*~ has multiple characters; only the first will be used.
One thing that I have observed is if lines are terminated other than \n or new line, then its only inserting one record into the database when you export. I tried couple of combination with field and line termination but only in case of line is terminated with \n data is exported into RDBMS table
Even tried with --input-lines-terminated-by and --lines-terminated-by arguments but no luck.
I have tested this on
Cloudera CDH-5.0.0-1
Sqoop version: 1.4.4-cdh5.0.0
Only thing that I'm able to find is this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With