设想:
当我输入 sqoop 导入查询时,我得到如下:
错误:
hadoop@ubuntu:~/sqoop-1.1.0/bin$ ./sqoop-import --driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver' --connect 'jdbc:sqlserver://192.168.xx.xx;database=HadoopTest;user=xxxxx;password=xxxxxx' --table PersonInfo1 --target-dir /data/PersonInfoData --check-column email --incremental append --compress11/12/10 15:52:50 INFO tool.CodeGenTool: Beginning code generation
11/12/10 15:52:50 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM PersonInfo1 AS t WHERE 1=0
11/12/10 15:52:50 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM PersonInfo1 AS t WHERE 1=0
11/12/10 15:52:51 INFO orm.CompilationManager: HADOOP_HOME is /home/hadoop/hadoop-0.21.0/bin/..
11/12/10 15:52:51 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/e8d9b5cc0800d8cde97f533f477a8ebd/PersonInfo1.jar
11/12/10 15:52:51 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: com.microsoft.sqlserver.jdbc.SQLServerException: An error occurred while converting the varchar value to JDBC data type DECIMAL.
at com.cloudera.sqoop.tool.ImportTool.initIncrementalConstraints(ImportTool.java:235)
at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:345)
at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:423)
at com.cloudera.sqoop.Sqoop.run(Sqoop.java:134)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:69)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:83)
at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:170)
at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:196)
at com.cloudera.sqoop.Sqoop.main(Sqoop.java:205)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: An error occurred while converting the varchar value to JDBC data type DECIMAL.
at com.microsoft.sqlserver.jdbc.DDC.convertStreamToObject(DDC.java:473)
at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(dtv.java:2474)
at com.microsoft.sqlserver.jdbc.DTV.getValue(dtv.java:176)
at com.microsoft.sqlserver.jdbc.Column.getValue(Column.java:113)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:1981)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:1966)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getBigDecimal(SQLServerResultSet.java:2596)
at com.cloudera.sqoop.tool.ImportTool.getMaxColumnId(ImportTool.java:187)
at com.cloudera.sqoop.tool.ImportTool.initIncrementalConstraints(ImportTool.java:230)
... 8 more
Caused by: java.lang.NumberFormatException
at java.math.BigDecimal.<init>(BigDecimal.java:459)
at java.math.BigDecimal.<init>(BigDecimal.java:728)
at com.microsoft.sqlserver.jdbc.DDC.convertStringToObject(DDC.java:285)
at com.microsoft.sqlserver.jdbc.DDC.convertStreamToObject(DDC.java:436)
... 16 more
问题:
为什么会这样?请建议我解决这个问题。
谢谢。