hive入门时,导数据后,执行:select count(1) from info_house_history;
报错:
hive (real_estate)> select count(1) from info_house_history;
Query ID = root_20220427100959_bf6dedc3-acff-4467-812d-45c15226f385
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
set mapreduce.job.reduces=<number>
2022-04-27 10:10:05 INFO client.AHSProxy: Connecting to Application History server at udp02/10.12.3.12:10201
2022-04-27 10:10:06 INFO client.AHSProxy: Connecting to Application History server at udp02/10.12.3.12:10201
Starting Job = job_1649670158454_0015, Tracking URL = http://udp01:8088/proxy/application_1649670158454_0015/
Kill Command = /opt/usdp-srv/srv/udp/2.0.0.0/yarn/bin/mapred job -kill job_1649670158454_0015
Hadoop job information for Stage-1: number of mappers: 0; number of reducers: 0
2022-04-27 10:10:32,111 Stage-1 map = 0%, reduce = 0%
Ended Job = job_1649670158454_0015 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
纠结再三,方法找了不少。最后终于灵光一现:
进入hive前,不是hadoop账户,而是root进入的。因此,先切换 到hadoop,然后再 hive shell,进入后在 selec count() 。问题解决!!!
在学习Hive时遇到执行`select count(1) from info_house_history`报错的问题,错误信息显示Job 1 out of 1失败,无mapper和reducer任务。通过检查发现是在root账户下运行Hive,解决方案是切换到hadoop账户再执行Hive命令,问题得到解决。

935

被折叠的 条评论
为什么被折叠?



