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]
Created on 06-20-2016 03:16 AM - edited 09-16-2022 03:26 AM
Hi There,
my file is "^A " delimted which i want to export using sqoop . do you know how can we handle such special charater .
Created 06-20-2016 04:09 AM
The "^A" is a visual shell representation of the ASCII hexadecimal byte "01".
You can run your command as so, making use of the actual byte representation than a visual helper:
sqoop export --connect jdbc:oracle:thin:olap7964/[email protected]:1521:ORCLOBIA11G --username XXXXXXX --password XXXXXXX --export-dir /user/hive/warehouse/abc.db/sach_sport --table SACH_SPORT --fields-terminated-by $'\x01' -m 1
Created 06-20-2016 03:26 AM
Can you try using '\' as '\^A'
Created 06-20-2016 03:41 AM
It is not working.. pfb log for your refernece .
hduser@jgusbihdpmaster:/tmp$ sqoop export --connect jdbc:oracle:thin:olap7964/[email protected]:1521:ORCLOBIA11G --username XXXXXXX --password XXXXXXX --export-dir /user/hive/warehouse/abc.db/sach_sport --table SACH_SPORT --fields-terminated-by '\^A' -m 1 Warning: /opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/bin/../lib/sqoop/../accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation. 16/06/20 03:37:39 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.5.1 16/06/20 03:37:39 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. Cannot understand character argument: \^A
Created 06-20-2016 04:07 AM
Can you try:
TERMINATED BY '\136'
Created 06-20-2016 04:10 AM
Nope.. Same error..
Created 06-20-2016 04:09 AM
The "^A" is a visual shell representation of the ASCII hexadecimal byte "01".
You can run your command as so, making use of the actual byte representation than a visual helper:
sqoop export --connect jdbc:oracle:thin:olap7964/[email protected]:1521:ORCLOBIA11G --username XXXXXXX --password XXXXXXX --export-dir /user/hive/warehouse/abc.db/sach_sport --table SACH_SPORT --fields-terminated-by $'\x01' -m 1
Created 06-20-2016 04:13 AM
yeah... its working..
i was able to find out its hex value (its control-v + control-a) character but was not applying '$' symbol.
Thank you so much .. 🙂
really appreciated..