Handling Chinese /Japense characters in sqoop import


Handling Chinese /Japense characters in sqoop import



I am trying to do sqoop import from db2, where table contains Chinese characters in 2 columns like 燃油油位传感器



Using below sqoop command:


sqoop job -conf /app1/sqoop-metastore/jdcp/sqoop-site.xml --create <jobname>
-- import --connect <connectionstring> --username <xxx> --password-file <xxx>
--table <ttt> --target-dir <targetpath> --fields-terminated-by '07' --map-
column-java DTC_NAME=String,DTC_DESC=String -m 1 --delete-target-dir



Getting below error:



Error: java.io.IOException: SQLException in nextKeyValue
Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.15.120] Caught java.io.CharConversionException. See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at com.ibm.db2.jcc.am.q.a(q.java:45)
at com.ibm.db2.jcc.am.jc.a(jc.java:2862)
... 20 more



Could you please provide some pointers?
Thanks in advance.





What's your target-Db2-database (or table/column/tablespace ) encoding and territory? What's your sqoop session locale ? What Db2-driver version are you using?
– mao
Jul 2 at 14:10





Can you try Sqoop HIve import with --query option use --map-column-hive with Sqoop hive import
– Sandeep Singh
Jul 2 at 14:11



--query


--map-column-hive





Did you try community.hortonworks.com/questions/99600/… or community.hortonworks.com/content/supportkb/198290/…?
– tk421
Jul 2 at 19:34









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages