You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Jazz Yao-Tsung Wang <ja...@gmail.com> on 2015/06/01 13:28:31 UTC

Import from Table with special character field name

If the import table is with special character in field name and unsupported
data type,
what can I do with `sqoop --map-column-java` ?

Such as Oracle Table

@MABCNO    GRAPHIC(12)
VECTOR$      RAW

I try following command but fail. Is there any suggestions ?

sqoop import --connect "jdbc:db2://X.X.X.X:50000/DBSRC" --username jazz -P
--map-column-java _MABCNO=STRING

- Jazz

Re: Import from Table with special character field name

Posted by Jazz Yao-Tsung Wang <ja...@gmail.com>.
Hi Abe,

Great thanks for your prompt response.
I'll first give it a try with "quoting column names" after
"--map-column-java".

PS. I'm using Sqoop 1.4.3-cdh4.7.1 now. Planning to migrate to CDH5.4 for
sure.

- Jazz


On Mon, Jun 1, 2015 at 10:53 PM, Abraham Elmahrek <ab...@cloudera.com> wrote:

> Hey man,
>
> Send over your exception?
>
> If you're having difficulty sending special characters is the terminal,
> you might be able to get away with quoting your column names. If you're
> importing data that should be treated differently in Sqoop,
> "--map-column-java" will do the trick. You can use a "free-form" query to
> cast the data types as well. See
> http://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_free_form_query_imports
> for more information there.
>
> -Abe
>
> On Mon, Jun 1, 2015 at 2:28 PM, Jazz Yao-Tsung Wang <jazzwang.tw@gmail.com
> > wrote:
>
>> If the import table is with special character in field name and
>> unsupported data type,
>> what can I do with `sqoop --map-column-java` ?
>>
>> Such as Oracle Table
>>
>> @MABCNO    GRAPHIC(12)
>> VECTOR$      RAW
>>
>> I try following command but fail. Is there any suggestions ?
>>
>> sqoop import --connect "jdbc:db2://X.X.X.X:50000/DBSRC" --username jazz
>> -P --map-column-java _MABCNO=STRING
>>
>> - Jazz
>>
>
>

Re: Import from Table with special character field name

Posted by Abraham Elmahrek <ab...@cloudera.com>.
Hey man,

Send over your exception?

If you're having difficulty sending special characters is the terminal, you
might be able to get away with quoting your column names. If you're
importing data that should be treated differently in Sqoop,
"--map-column-java" will do the trick. You can use a "free-form" query to
cast the data types as well. See
http://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_free_form_query_imports
for more information there.

-Abe

On Mon, Jun 1, 2015 at 2:28 PM, Jazz Yao-Tsung Wang <ja...@gmail.com>
wrote:

> If the import table is with special character in field name and
> unsupported data type,
> what can I do with `sqoop --map-column-java` ?
>
> Such as Oracle Table
>
> @MABCNO    GRAPHIC(12)
> VECTOR$      RAW
>
> I try following command but fail. Is there any suggestions ?
>
> sqoop import --connect "jdbc:db2://X.X.X.X:50000/DBSRC" --username jazz -P
> --map-column-java _MABCNO=STRING
>
> - Jazz
>