leo_1989 发表于 2013-10-16 13:41:14

sqoop导出oracle问题:Field names must be greater than 0

用sqoop从hive导出数据到oracle遇到Field names must be greater than 0错误
oracle表:sqooptest(id varchar2(20),name varchar2(40));
hive表:create table testdata(id string,name string)row format delimited fields terminated by '\|';
导出脚本:
sqoop export --connect jdbc:oracle:thin:@192.168.21.105:1521:orcl --username hadoop --password hadoop1234 --table sqooptest --export-dir /user/hive/warehouse/testdata/--input-fields-terminated-by "|"
错误信息如下:
12/05/30 16:21:15 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.IllegalArgumentException: Field names must be greater than 0
java.lang.IllegalArgumentException: Field names must be greater than 0
      at com.cloudera.sqoop.mapreduce.db.DBOutputFormat.setOutput(DBOutputFormat.java:205)
      at com.cloudera.sqoop.mapreduce.JdbcExportJob.configureOutputFormat(JdbcExportJob.java:86)
      at com.cloudera.sqoop.mapreduce.ExportJobBase.runExport(ExportJobBase.java:332)
      at com.cloudera.sqoop.manager.OracleManager.exportTable(OracleManager.java:354)
      at com.cloudera.sqoop.tool.ExportTool.exportTable(ExportTool.java:73)
      at com.cloudera.sqoop.tool.ExportTool.run(ExportTool.java:110)
      at com.cloudera.sqoop.Sqoop.run(Sqoop.java:144)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
      at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:180)
      at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:218)
      at com.cloudera.sqoop.Sqoop.main(Sqoop.java:228)
            
               
               

leo_1989 发表于 2013-10-16 13:41:44


            问题已解决,是我没有把oracle的表名大写,网上找到的例子基本是mysql的,mysql的例子貌似都没有大写,但是具体什么原因我也不清楚。
页: [1]
查看完整版本: sqoop导出oracle问题:Field names must be greater than 0