Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
09-30-2020
04:51 PM
- last edited on
04-21-2026
04:24 AM
by
GrazittiAPI
I'm trying to test Sqoop action in the following environment:
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
Created 09-30-2020 10:20 PM
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.
Created 10-01-2020 02:19 PM
Hi @aakulov
Thanks very much for your help.
We used --hs2-url and sqoop works fine.
best regards,
Eduardo
Created 09-30-2020 10:20 PM
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.
Created 10-01-2020 02:19 PM
Hi @aakulov
Thanks very much for your help.
We used --hs2-url and sqoop works fine.
best regards,
Eduardo