1. 程式人生 > >sqoop執行hive匯入報錯

sqoop執行hive匯入報錯

錯誤日誌:

2018-09-17 14:50:57,932 INFO [OutputFormatLoader-consumer] com.chinacreator.sqoop.connector.hive.HiveLoader: load sql:LOAD DATA INPATH '/f95af4b623d14fba929e4ef26facd456.txt' INTO TABLE wfxtest
2018-09-17 14:50:57,932 INFO [OutputFormatLoader-consumer] com.chinacreator.sqoop.connector.hive.HiveLoader: Statement:
[email protected]
2018-09-17 14:50:58,050 ERROR [OutputFormatLoader-consumer] org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor: Error while loading data out of MR job. org.apache.sqoop.common.SqoopException: CORE_0000:An unknown error has occurred at org.apache.sqoop.utils.ClassUtils.executeWithClassLoader(ClassUtils.java:286) at org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor$ConsumerThread.run(SqoopOutputFormatLoadExecutor.java:259) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at com.chinacreator.sqoop.connector.hive.HiveLoader.load(HiveLoader.java:226) at com.chinacreator.sqoop.connector.hive.HiveLoader.load(HiveLoader.java:36) at org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor$ConsumerThread$1.call(SqoopOutputFormatLoadExecutor.java:279) at org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor$ConsumerThread$1.call(SqoopOutputFormatLoadExecutor.java:260) at org.apache.sqoop.utils.ClassUtils.executeWithClassLoader(ClassUtils.java:281) ... 6 more 2018-09-17 14:50:58,058 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : org.apache.sqoop.common.SqoopException: MAPRED_EXEC_0018:Error occurs during loader run at org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor$ConsumerThread.run(SqoopOutputFormatLoadExecutor.java:292) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

解決辦法:

日誌中加列印:LOAD DATA INPATH '/f95af4b623d14fba929e4ef26facd456.txt' INTO TABLE wfxtest,因為表wfxtest所在的是另外的資料庫中,所以前面需要改為:

資料庫.表名