Sqoop Import String哈希值具有特殊字符

时间:2016-05-11 17:13:32

标签: oracle hadoop sqoop

Sqoop Import String哈希值具有特殊字符,并且失败并出现以下异常。

2016-05-10 16:49:00,506 INFO [LocalJobRunner Map Task Executor#0] db.DBRecordReader(DBRecordReader.java:executeQuery(110)) - 执行查询:SELECT JCP_STR_CNTCT_INFO.SHIPPING_GROUP_ID,JCP_STR_CNTCT_INFO.STR_ID ,JCP_STR_CNTCT_INFO.FRST_NM,JCP_STR_CNTCT_INFO.LAST_NM,JCP_STR_CNTCT_INFO.CNTCT_PHN_NB,JCP_STR_CNTCT_INFO.TEXT_ALERT_MOBILE_NB,JCP_STR_CNTCT_INFO.EMAIL_ID,JCP_STR_CNTCT_INFO.IS_PRIM_PICKUP_IN FROM DT_PRD_CORE.JCP_STR_CNTCT_INFO,DT_PRD_CORE.DCSPP_SHIP_GROUP,DT_PRD_CORE.DCSPP_ORDER WHERE JCP_STR_CNTCT_INFO.SHIPPING_GROUP_ID = DCSPP_SHIP_GROUP.SHIPPING_GROUP_ID AND DCSPP_SHIP_GROUP.ORDER_REF = DCSPP_ORDER .ORDER_ID AND(JCP_STR_CNTCT_INFO.SHIPPING_GROUP_ID> =' sg10038415')AND(JCP_STR_CNTCT_INFO.SHIPPING_GROUP_ID<' sg31쀰耲䀶4䀲'') 2016-05-10 16:49:00,535 ERROR [LocalJobRunner Map Task Executor#0] db.DBRecordReader(LoggingUtils.java:logAll(43)) - 顶级异常: java.sql.SQLSyntaxErrorException:ORA-01756:引用的字符串未正确终止     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)     at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)     在oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)     at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)     在oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)     at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)     at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)     at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)     at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3657)     at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)     在org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)     在org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:235)     at org.apache.hadoop.mapred.MapTask $ NewTrackingRecordReader.nextKeyValue(MapTask.java:556)     at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80)     at org.apache.hadoop.mapreduce.lib.map.WrappedMapper $ Context.nextKeyValue(WrappedMapper.java:91)     在org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)     在org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)     在org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)     在org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)     在org.apache.hadoop.mapred.LocalJobRunner $ Job $ MapTaskRunnable.run(LocalJobRunner.java:243)     at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745) 2016-05-10 16:49:00,554 INFO [Thread-665] mapreduce.AutoProgressMapper(ProgressThread.java:run(158)) - 自动进度线程完成。 keepGoing =假

1 个答案:

答案 0 :(得分:0)

IN sqoop您可以使用以下参数

更改字符集导入数据
--default-character-set=<your character set>

我建议您检查一下Oracle数据库字符集,并尝试在上面的sqoop参数中进行相应的设置

来源:Sqoop Document