使用BigInt数据类型导致Sqoop导入错误

时间:2013-12-23 07:14:53

标签: sql-server hive sqoop

将表从SQLServer导入Hive时,我面临以下异常

/tmp/sqoop-hduser/compile/a6db7754847c4d49c9164758fcc079d7/ReceivedData.java:513:      error: incompatible types
this.IDReceivedData = Long.valueOf(__dataIn.readLong());
required: Long
found:    Double                                     
/tmp/sqoop-hduser/compile/a6db7754847c4d49c9164758fcc079d7/ReceivedData.java:1007:    error:   incompatible types
  this.IDReceivedData = Long.valueOf(__cur_str);
                                    ^
required: Long
found:    Double
Note: /tmp/sqoop-hduser/compile/a6db7754847c4d49c9164758fcc079d7/ReceivedData.java uses  or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

以下是用于导入表格的命令

特定列(IDReceivedData)的数据类型是数据库中的BigInt。这可能是什么问题?我是否必须更改数据库中列的数据类型?或使用sqoop import命令进行任何其他更改。

sqoop import --connect "jdbc:sqlserver://<ip>:1433;database=temp;user=sa;password=pass" --table ReceivedData --hive-table temp.ReceivedData

任何帮助都将不胜感激。

谢谢, 卡莱

1 个答案:

答案 0 :(得分:3)

Sqoop目前不支持BigInteger,对于解决方法,您可以将特定列映射为字符串

--map-column-java IDReceivedData=String