【问题标题】:FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask during join operation in hive失败:执行错误,在 hive 中加入操作期间从 org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask​​ 返回代码 2
【发布时间】:2018-05-30 10:17:44
【问题描述】:

我正在尝试在 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

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

【问题讨论】:

  • 我们能看到/tmp/username/username_20180530154141_0a187506-7aca-442a-8310-582d335ad78d.log吗?或者,如果您使用的是 YARN,您是否看过那里的结果?

标签: hadoop join hive hiveql


【解决方案1】:

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

set hive.auto.convert.join = false;

这将有助于连接优化。

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

【讨论】:

    【解决方案2】:

    你可以在哪里使用下面的代码并尝试

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

    【讨论】:

      【解决方案3】:

      首先,确保你用来运行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;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多