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- Escape delimiters within data

Highlighted

Sqoop- Escape delimiters within data

Explorer

I'm trying to sqoop import from Teradata using the below command 

 

sqoop import --connect jdbc:teradata://xxx --username xxx-P 
--query "SELECT TOP 1000 col,col2 from tble where 1=1 AND \$CONDITIONS"
--escaped-by ',' --fields-terminated-by ','
--target-dir /hadoop/dev/test -m1

 

Currently the data has , in the fields and is not escaped using --escaped-by parameter too.

 

Is there any other way?

 

 

 

 

2 REPLIES 2

Re: Sqoop- Escape delimiters within data

Champion

@tkrish03

 

You can control it in your query itself instead of escape delimiter, it may help you

 

select  REGEXP_REPLACE(col1,',','') AS col1, col2 from tablename1

Re: Sqoop- Escape delimiters within data

Explorer

Thanks,but the now the problem looks like it has \n characters within data and unable to escape them.
Because hive-import-drop-delims parameter is also not supported in Teradata.
Any suggestions ?