Hive中运行任务报错:Error during job, obtaining debugging information...

错误

Ended Job = job_1545829388777_0070 with errors
Error during job, obtaining debugging information...
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched: 
Stage-Stage-1:  HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

失败原因
经查发现发现/tmp/hadoop/.log提示java.lang.OutOfMemoryError: Java heap space,原因是namenode内存空间不够,jvm不够新job启动导致。
解决方法
将你的hive可以设置成本地模式来执行任务试试:

hive> set hive.exec.mode.local.auto=true;

(默认为false)
成功

Automatically selecting local only mode for query
Query ID = root_20200529174117_c46dc2d7-b205-4ed4-8828-070482bcb879
Total jobs = 3
Launching Job 1 out of 3
Number of reduce tasks is set to 0 since there's no reduce operator
Job running in-process (local Hadoop)
2020-05-29 17:41:22,407 Stage-1 map = 100%,  reduce = 0%
Ended Job = job_local1707088349_0001
Stage-4 is selected by condition resolver.
Stage-3 is filtered out by condition resolver.
Stage-5 is filtered out by condition resolver.
Moving data to: hdfs://192.168.100.101:8020/user/hive/warehouse/test.db/student/.hive-staging_hive_2020-05-29_17-41-17_851_6573282266189803153-1/-ext-10000
Loading data to table test.student
Table test.student stats: [numFiles=1, numRows=1, totalSize=8, rawDataSize=7]
MapReduce Jobs Launched: 
Stage-Stage-1:  HDFS Read: 8 HDFS Write: 84 SUCCESS
Total MapReduce CPU Time Spent: 0 msec
OK
Time taken: 5.298 seconds

你可能感兴趣的:(Hive中运行任务报错:Error during job, obtaining debugging information...)