Support Questions
Find answers, ask questions, and share your expertise

(NEW INSTALL) Sqoop 1.4.7.7 / CDP 7.1.3 hive.HiveImport get error: java.io.IOException: Hive exited with status 4

Explorer

I'm trying to test Sqoop action in the following environment:

  • CDP 7.1.3  (new instalation)
  • Sqoop 1.4.7

Via the command line, the following sqoop command works:

sudo -su hdfs sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter = true" --connect jdbc:oracle:thin:@XXXXXXXXXXXX:1521/orcl --username XXXXX --password XXXX --table "HR.JOBS" --delete-target-dir --as-parquetfile --null-string '\\N' --null-non-string '\\N' --hive-import --create-hive-table --hive-table default.jobs

 

Sqoop connects in Oracle Database and write parquet files into HDFS. 

 

But when try load data into Hive. getting this error: Import failed: java.io.IOException: Hive exited with status 4:

 

20/09/30 23:32:03 INFO hive.HiveImport: Loading uploaded data into Hive
20/09/30 23:32:03 INFO hive.HiveImport: Cannot find hadoop installation: $HADOOP_HOME or $HADOOP_PREFIX must be set or hadoop must be in the path
20/09/30 23:32:03 ERROR tool.ImportTool: Import failed: java.io.IOException: Hive exited with status 4
at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:253)
at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:206)
at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:273)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:564)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:655)
at org.apache.sqoop.Sqoop.run(Sqoop.java:151)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:187)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:241)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:250)
at org.apache.sqoop.Sqoop.main(Sqoop.java:259)

 

Any help would be greatly appreciated!

Thanks

2 ACCEPTED SOLUTIONS

Super Collaborator

You can try doing the import with --hs2-url parameter as described in this Cloudera doc. This is another approach to get sqoop import to connect to Hive, given that the standard way with HDOOP_HOME doesn't seem to work. 

 

Also note that sqoop parameters should be --hive-database default --hive-table jobs. This is related to Hive-16907, and while your syntax is currently allowed in sqoop, it soon may be validated away.

 

Hope this helps.

View solution in original post

Explorer

Hi @aakulov 

 

 Thanks very much for your help.  

 

 We used --hs2-url  and sqoop works fine.

 

best regards,

 

Eduardo

 

 

View solution in original post

2 REPLIES 2

Super Collaborator

You can try doing the import with --hs2-url parameter as described in this Cloudera doc. This is another approach to get sqoop import to connect to Hive, given that the standard way with HDOOP_HOME doesn't seem to work. 

 

Also note that sqoop parameters should be --hive-database default --hive-table jobs. This is related to Hive-16907, and while your syntax is currently allowed in sqoop, it soon may be validated away.

 

Hope this helps.

Explorer

Hi @aakulov 

 

 Thanks very much for your help.  

 

 We used --hs2-url  and sqoop works fine.

 

best regards,

 

Eduardo

 

 

; ;