Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Sqoop - export file with multiple delimiter

Explorer

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

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.

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.