1. 程式人生 > >java.io.IOException: java.lang.reflect.InvocationTargetException 問題的解決

java.io.IOException: java.lang.reflect.InvocationTargetException 問題的解決

執行

select  * from tb where createtime >= '2014-02-13'  and createtime < '2014-02-14' limit 10;

報下列錯誤:

Error during job, obtaining debugging information...
Job Tracking URL: http://192-168-102-155:50030/jobdetails.jsp?jobid=job_201309041025_117599
Examining task ID: task_201309041025_117599_m_000005 (and more) from job job_201309041025_117599
Examining task ID: task_201309041025_117599_m_000000 (and more) from job job_201309041025_117599

Task with the most failures(4):
-----
Task ID:
  task_201309041025_117599_m_000001

URL:
  http://192-168-102-155:50030/taskdetails.jsp?jobid=job_201309041025_117599&tipid=task_201309041025_117599_m_000001
-----
Diagnostic Messages for this Task:
java.io.IOException: java.lang.reflect.InvocationTargetException
        at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
        at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
        at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.initNextRecordReader(HadoopShimsSecure.java:341)
        at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.<init>(HadoopShimsSecure.java:288)
        at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileInputFormatShim.getRecordReader(HadoopShimsSecure.java:402)
        at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getRecordReader(CombineHiveInputFormat.java:544)
        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:370)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:324)
        at org.apache.hadoop.mapred.Child$4.run(Child.java:266)
        at java.security.AccessController.doPrivileged(Native

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask

執行

select * from tb limit 10;

報錯資訊:

Failed with exception java.io.IOException:java.io.IOException: Malformed ORC file hdfs://192-168-102-154:9000/user/hive/warehouse/******/2014-02-11.txt. Invalid postscript.

表的檔案格式為orc 但是同事從其它系統導資料的時候 放了幾個資料夾的txt 檔案。

 用orc檔案格式的表去讀取text格式的檔案 顯然會報錯。

因而上述的問題也得到很好解釋。

解決辦法  將orc表下面的text所有資料夾的資料mv到其它的目錄下面。