Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop export with multi delimiter

Sqoop export with multi delimiter

New Contributor

Hi,

I have my data inside hive table which has multiple delimiter(#|) and now wanted to export this data to my sql using sqoop. I have tried several options but sqoop does not support multi-delimiter. One of the field is the name field that contains special character. So to avoid using single special character, have used double special character as delimiter.

Is there way in Sqoop to export with multiple delimiter? The sqoop job creates a JAVA where the delimiters are specified as char. Can I modify this JAVA file with modified delimiter(string) and use in sqoop? Please advice how this can be done.

Also, incase if I am using enclosed by(#) and field terminated by(|) in hive and I sqoop that data, how will the data which has (|) as part of data be handled? e.g #12345#|#ABC|def#

Thank you.

2 REPLIES 2

Re: Sqoop export with multi delimiter

Contributor

@Revathy Mourouguessane No, you cannot use multiple delimiter with sqoop export. Enclosed by(#) and field terminated by(|) might not work with your dataset. You could try copying the data to another hive table using "\b" (backspace) as delimiter and then you should able to export the data to my sql.

Re: Sqoop export with multi delimiter

Contributor

@Revathy Mourouguessane

https://stackoverflow.com/questions/21234370/how-to-change-the-field-terminated-value-for-an-existin...

This link would be useful to change the delimiter field without having to copy data to another table.