失败:执行错误,在 hive 中的联接操作期间从 org.apache.hadoop.hive.ql.exec.mr.M



>我正在尝试在以下两个表上运行 hive 中的连接查询-

select b.location from user_activity_rule a inner join user_info_rule b where a.uid=b.uid and a.cancellation=true;
Query ID = username_20180530154141_0a187506-7aca-442a-8310-582d335ad78d
Total jobs = 1
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
Execution log at: /tmp/username/username_20180530154141_0a187506-7aca-442a-8310-582d335ad78d.log
2018-05-30 03:41:51     Starting to launch local task to process map join;      maximum memory = 2058354688
Execution failed with exit status: 2
Obtaining error information
Task failed!
Task ID:
Stage-4
Logs:
/tmp/username/hive.log
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask

此错误是什么意思以及如何解决此问题?

当您尝试运行的作业内存不足时,会发生这种情况。 克服此问题的一种方法是使用此命令:

set hive.auto.convert.join = false;

这将有助于联接优化。

有时,当使用它的并发用户数很高(在某个高峰时间(时,就会发生这种情况。 或者,您可以在没有很多用户使用它时触发此查询。显然,会有 大量可用内存,以便您的作业可以消耗所需的内存。在以下情况下可以采用此替代方法 开发环境中的节点较少,您可以确定生产中不会出现内存问题。

而不是在哪里可以使用下面的代码并尝试

SELECT b.location FROM user_activity_rule a JOIN user_info_rule b ON(a.uid=b.uid) WHERE a.cancellation="true";

首先,确保您用于运行 SQL 的HADOOP_USER可以运行MapReduce

然后,使用如下所示的 SQL:

set hive.auto.convert.join = false;
select b.location 
from user_activity_rule a 
inner join user_info_rule b 
where a.uid=b.uid and a.cancellation=true;

相关内容

最新更新