You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Sandish Kumar HN (JIRA)" <ji...@apache.org> on 2017/08/30 20:16:00 UTC
[jira] [Commented] (SQOOP-869) Sqoop can not append data to hive in
SequenceFiles format
[ https://issues.apache.org/jira/browse/SQOOP-869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147979#comment-16147979 ]
Sandish Kumar HN commented on SQOOP-869:
----------------------------------------
[~zhangguancheng] sqoop import -as-sequencefile works fine but while doing import sqoop create's a table-name.class inside the sequencefile. so when ever you query a table on hive it expects table-name.class (you need to do add jar tablename.jar in hive). try once
coming to your question: 2) failed while step 1) succeeded.
1) succeeded. but you can't query on hive without table-name.jar
2) sqoop import -as-sequencefile --append
sqoop import use "load data inpath 'path' into tablename" command - which again expects table-name.jar (you need to do "add jar tablename.jar" in hive) which is not been done on sqoop hive import for -as-sequencefile
anyways currently we are throwing an exception for hive-import -as-sequencefile
> Sqoop can not append data to hive in SequenceFiles format
> ---------------------------------------------------------
>
> Key: SQOOP-869
> URL: https://issues.apache.org/jira/browse/SQOOP-869
> Project: Sqoop
> Issue Type: Bug
> Components: hive-integration
> Affects Versions: 1.4.2
> Reporter: zhangguancheng
> Assignee: Sandish Kumar HN
>
> To reproduce it, do the following:
> 1) sqoop import --hive-import --connect jdbc:oracle:thin:@###.###.###.###:###:orcl --username ### --password ### --target-dir /###/### --hive-home /###/### --hive-table ### --as-sequencefile --query "select # from "###"."###" where \$CONDITIONS" --create-hive-table --class-name ### --outdir /###/### --bindir /###/### --map-column-hive ###=STRING,###=BIGINT,###=BIGINT
> 2) sqoop import --hive-import --connect jdbc:oracle:thin:@###.###.###.###:###:orcl --username ### --password ### --target-dir /###/### --hive-home /###/### --hive-table ### --as-sequencefile --query "select # from "TEST1"."BAI" where \$CONDITIONS" -append --class-name ### --outdir /###/### --bindir /###/### --map-column-hive ###=STRING,###=BIGINT,###=BIGINT
> And the output of step 2) will be something like:
> {noformat}
> 12/05/04 23:47:07 INFO hive.HiveImport: OK
> 12/05/04 23:47:07 INFO hive.HiveImport: Time taken: 3.996 seconds
> 12/05/04 23:47:08 INFO hive.HiveImport: Loading data to table default.###
> 12/05/04 23:47:09 INFO hive.HiveImport: Failed with exception java.lang.RuntimeException: java.io.IOException: WritableName can't load class: ***
> 12/05/04 23:47:09 INFO hive.HiveImport: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
> 12/05/04 23:47:09 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Hive exited with status 9
> at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:375)
> at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:315)
> at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:227)
> at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:415)
> at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
> at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
> at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
> at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
> at com.cloudera.sqoop.Sqoop.main(Sqoop.java:57)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)