Created 09-30-2020 04:51 PM
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