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.

How to export special characters using sqoop from hive to Mysql ?

Highlighted

How to export special characters using sqoop from hive to Mysql ?

New Contributor

I'm trying to export one of the tables from hive to MySQL using sqoop export. The hive table data contains the special characters.

My hive table:

==========

id message

1じゃあまた

2どうぞ

I have used the below sqoop command:

<code>sqoop export --verbose --connect jdbc:mysql://xx.xx.xx.xxx/Sampledb?useUnicode=true&characterEncoding=UTF-8 --username abc --password xyz --table special_char --direct --driver com.mysql.jdbc.Driver  --export-dir /apps/hive/warehouse/sampledb.db/special_char --fields-terminated-by ' '

But it is throwing an error statiting : "Unrecognized argument: —username"

If I use jdbc:mysql://xx.xx.xx.xxx/Sampledb this instead of jdbc:mysql://xx.xx.xx.xxx/Sampledb?useUnicode=true&characterEncoding=UTF-8 in the above sqoop command, then I'm able to export the records into Mysql but the message column is loaded with "?????" instead of the actual japanese characters.

MySQL table:

=========

id message

1 ?????

2 ???

Can anyone please help me out regarding the same ...

Don't have an account?
Coming from Hortonworks? Activate your account here