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.

sqoop2 and issue with single quote

Highlighted

sqoop2 and issue with single quote

New Contributor

I am using Sqoop2 to import data from Oracle to HDFS and using impala tables to query on that data.  However when we import data from Oracle with Sqoop2,  we are seeing data in HDFS with strings as single quote for example state is looking like 'MaryLand'.  How do I take out single quote on string when I import data through Sqoop2?  The idea is we want to run sqoop2 to imports and run impala queries on it.

 

Please see below impala query  and you see 'CA' like that.  Does sqoop2 when it move data in HDFS for strings does it put single quotes. If so I do I query without showing single quote or is there anyway while sqoop I can take out single quote.  Please let us know.

 

select * from gis_designated_areas

 

'9'  'CA', 'California'

6 REPLIES 6

Re: sqoop2 and issue with single quote

Expert Contributor
Hey there,

Sqoop2 does use ' as its quote character. Sqoop2 is under heavy development. Such things should be configurable in the near future.

-Abe

Re: sqoop2 and issue with single quote

New Contributor

This means do I need to change sqoop from sqoop2. When why CDH5 providing sqoop2 as defualt service.  Also is there any our option

Re: sqoop2 and issue with single quote

Expert Contributor
Hey there,

I think I've misunderstood your original question. You should be able to remove quotes using a free-form query.

-Abe

Re: sqoop2 and issue with single quote

New Contributor

Sorry to ask. . Whati s  free-form query? Does this mean I need to run a query to remove quote on impala side and anything to do with Sqoop2 itself

 

Any example on both side will be great help

Re: sqoop2 and issue with single quote

Expert Contributor
In Sqoop you can do transformations at the Oracle level with a free-form query: http://sqoop.apache.org/docs/1.4.5/SqoopUserGuide.html#_free_form_query_imports. Then, if there are any quotes that you'd like to remove at the impala level, there should be a regexp replace function: http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/Installing-and-Using-Im...

Re: sqoop2 and issue with single quote

New Contributor

We are using sqoop2 for importing tables from Mysql to HDFS and using Hive to query over that. But Sqoop2 enclosing columns of string type with single Quotes. 

How do I take out single quote on string when I import data through Sqoop2 ? Is there any option available to disable column enclosing ?