sqoop條件抽取報錯distcp
Sqoop抽取語句如下:
/usr/local/sqoop-1.4.6/bin/sqoop import \
--connect jdbc:mysql://10.13.50.125:3306/longer \
--username sqoop \
--password XXXXXX \
--query " select * from tabname where scheduled_deptime between UNIX_TIMESTAMP('$v_begin_date') and UNIX_TIMESTAMP('$v_end_date') and \$CONDITIONS " \
--hive-database testdb\
--hive-table tabname _test \
--hive-import \
--split-by dynamic_id \
--target-dir /user/hive/sqptarget \
--bindir /home/hadoop/new_binddir \
--outdir /home/hadoop/new_binddir \
--direct \
-m 8
--------------------------------------------------------------------------------
報錯如下(片段):
18/07/06 15:25:41 INFO common.FileUtils: Source is 76566465 bytes. (MAX: 33554432)
18/07/06 15:25:41 INFO common.FileUtils: Launch distributed copy (distcp) job.
18/07/06 15:25:41 ERROR metadata.Hive: Failed to move: java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
Failed with exception java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
18/07/06 15:25:41 ERROR exec.Task: Failed with exception java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
at org.apache.hadoop.hive.ql.metadata.Hive.copyFiles(Hive.java:2895)
at org.apache.hadoop.hive.ql.metadata.Hive.copyFiles(Hive.java:3205)
at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1920)
at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:364)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2084)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1755)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1463)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1181)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1171)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
--------------------------------------------------------------------------
原因: hive 最後移動資料的時候,需要呼叫hadoop-distcp-X.X.X.jar,
解決方法:只需要把$HADOOP_HOME/share/hadoop/tools/lib/hadoop-distcp-x.x.x.jar 複製 $HIVE_HOME/lib下面,重啟hive即可
/usr/local/sqoop-1.4.6/bin/sqoop import \
--connect jdbc:mysql://10.13.50.125:3306/longer \
--username sqoop \
--password XXXXXX \
--query " select * from tabname where scheduled_deptime between UNIX_TIMESTAMP('$v_begin_date') and UNIX_TIMESTAMP('$v_end_date') and \$CONDITIONS " \
--hive-database testdb\
--hive-table tabname _test \
--hive-import \
--split-by dynamic_id \
--target-dir /user/hive/sqptarget \
--bindir /home/hadoop/new_binddir \
--outdir /home/hadoop/new_binddir \
--direct \
-m 8
--------------------------------------------------------------------------------
報錯如下(片段):
18/07/06 15:25:41 INFO common.FileUtils: Source is 76566465 bytes. (MAX: 33554432)
18/07/06 15:25:41 INFO common.FileUtils: Launch distributed copy (distcp) job.
18/07/06 15:25:41 ERROR metadata.Hive: Failed to move: java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
Failed with exception java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
18/07/06 15:25:41 ERROR exec.Task: Failed with exception java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NoClassDefFoundError: org/apache/hadoop/tools/DistCpOptions
at org.apache.hadoop.hive.ql.metadata.Hive.copyFiles(Hive.java:2895)
at org.apache.hadoop.hive.ql.metadata.Hive.copyFiles(Hive.java:3205)
at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1920)
at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:364)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2084)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1755)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1463)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1181)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1171)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
--------------------------------------------------------------------------
原因: hive 最後移動資料的時候,需要呼叫hadoop-distcp-X.X.X.jar,
解決方法:只需要把$HADOOP_HOME/share/hadoop/tools/lib/hadoop-distcp-x.x.x.jar 複製 $HIVE_HOME/lib下面,重啟hive即可
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9606353/viewspace-2157457/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 條件索引 case when 報錯解決方案Oracle索引
- 查詢正常作為條件報錯的問題
- ef8 Contains 查詢條件 報錯 $ 附近錯誤AI
- 除錯——條件斷點除錯斷點
- OGG抽取程式報錯ORA-06512
- Laravel 傳送郵件報錯Laravel
- 報表查詢條件的 N 種使用方式
- 條件反射反射
- 條件渲染
- Laravel5.8 傳送郵件報錯Laravel
- Hive學習之七《 Sqoop import 從關聯式資料庫抽取到HDFS》HiveOOPImport資料庫
- 一條看似平常的報警郵件所做的分析
- SQL中on條件與where條件的區別[轉]SQL
- PL/SQL 條件SQL
- react 條件渲染React
- 條件和排序排序
- 條件技術
- 條件型別型別
- 條件語句
- 屈服條件8
- 條件函式函式
- Excel 條件格式Excel
- 一條關於swap爭用的報警郵件分析
- excel條件格式怎麼設定 excel條件格式在哪裡Excel
- Rust 條件編譯Rust編譯
- DMSQL LIMIT限定條件SQLMIT
- switch拼接where條件
- impala 條件函式函式
- JavaScript 條件運算子JavaScript
- github條件搜尋Github
- GO 條件語句Go
- jquery 多條件匹配jQuery
- js條件運算子JS
- MongoDB查詢條件MongoDB
- javaScript條件語句JavaScript
- MongoDB條件查詢MongoDB
- openGauss 前提條件
- mysql條件查詢MySql