You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by su...@bt.com on 2015/09/23 15:04:25 UTC

Problem with the SQOOP imported data in HDFS

Hello Everyone,

When I tried to import the below data from an Oracle table (columns delimited by ',') to HDFS using the below mentioned Sqoop command,

12345,1-1SKCE5P,null,2013-10-11 06:23:22.0,2014-12-02 14:22:32.0,Switched "INFONET CONFERENCING" GSP P3519,null,OS

sqoop import --connect jdbc:oracle:thin:@//xxxxx:xxxxx/xxxx_xxxx --username SUMAN --password-file /user/$USER/sqoop.password --table PRODUCTS --where "PRODUCT_KEY = '12345'" --fields-terminated-by , --escaped-by '\"' --optionally-enclosed-by '\"' --target-dir /user/SUMAN/PRODUCTS -m 1

the result is as below

12345,1-1SKCE5P,null,2013-10-11 06:23:22.0,2014-12-02 14:22:32.0,Switched """"INFONET CONFERENCING"""" GSP P3519,null,OS

Why there are four-four double quotes present in the data (underlined) imported to HDFS? Instead of just two-two?


Regards
Suman

Re: Problem with the SQOOP imported data in HDFS

Posted by Jarek Jarcec Cecho <ja...@apache.org>.
Could you try dropping the  --escaped-by '\”’ or use  some other character instead?

Jarcec

> On Sep 23, 2015, at 6:04 AM, sumanchaitanya.dasari@bt.com wrote:
> 
> Hello Everyone,
>  
> When I tried to import the below data from an Oracle table (columns delimited by ‘,’) to HDFS using the below mentioned Sqoop command,
>  
> 12345,1-1SKCE5P,null,2013-10-11 06:23:22.0,2014-12-02 14:22:32.0,Switched "INFONET CONFERENCING" GSP P3519,null,OS
>  
> sqoop import --connect jdbc:oracle:thin:@//xxxxx:xxxxx/xxxx_xxxx --username SUMAN --password-file /user/$USER/sqoop.password --table PRODUCTS --where "PRODUCT_KEY = '12345'" --fields-terminated-by , --escaped-by '\"' --optionally-enclosed-by '\"' --target-dir /user/SUMAN/PRODUCTS -m 1
>  
> the result is as below
>  
> 12345,1-1SKCE5P,null,2013-10-11 06:23:22.0,2014-12-02 14:22:32.0,Switched """"INFONET CONFERENCING"""" GSP P3519,null,OS
>  
> Why there are four-four double quotes present in the data (underlined) imported to HDFS? Instead of just two-two?
>  
>  
> Regards
> Suman