我正在把一堆oracle10g表放到hive中。我正在集群上开发hortonworkshdp2.3。一个包含100多列的oracle表有一个row\ id列,我发现它的类型是oracle.sql.rowid。sqoop正在引发错误:
2016-02-04 16:09:19,746 ERROR - [main:] ~ Cannot resolve SQL type -8 (ClassWriter:645)
2016-02-04 16:09:19,747 ERROR - [main:] ~ Cannot resolve SQL type -8 (ClassWriter:645)
2016-02-04 16:09:19,747 ERROR - [main:] ~ No Java type for SQL type -8 for column ROW_ID (ClassWriter:718)
2016-02-04 16:09:19,748 ERROR - [main:] ~ No Java type for SQL type -8 for column ROW_ID (ClassWriter:718)
2016-02-04 16:09:19,749 ERROR - [main:] ~ No Java type for SQL type -8 for column ROW_ID (ClassWriter:798)
2016-02-04 16:09:19,756 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181)
java.lang.NullPointerException
at org.apache.sqoop.orm.ClassWriter.parseNullVal(ClassWriter.java:1377)
at org.apache.sqoop.orm.ClassWriter.parseColumn(ClassWriter.java:1402)
at org.apache.sqoop.orm.ClassWriter.myGenerateParser(ClassWriter.java:1528)
at org.apache.sqoop.orm.ClassWriter.generateParser(ClassWriter.java:1491)
at org.apache.sqoop.orm.ClassWriter.generateClassForColumns(ClassWriter.java:1920)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1736)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
有没有一种方法可以将这个oracle列类型Map到任何配置单元列类型,或者只将其设置为字符串?
1条答案
按热度按时间s1ag04yj1#
好吧,不确定这样做对不对。但无论如何。
首先我试过了
--map-column-hive ROW_ID=String
,它仍然在抱怨同样的错误。然后我试着
--map-column-java ROW_ID=String
,它很高兴地从oracle下载了数据,但还没有准备好将其放入配置单元:嗯,最后他们的组合很好。
也,
--split-by
我也不喜欢那排。所以我不得不用另一个专栏。-干杯。