【问题标题】:Getting FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask exception while access Hive views失败:执行错误,在访问 Hive 视图时从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 异常返回代码 2
【发布时间】:2019-01-10 21:26:01
【问题描述】:

我正在尝试访问 Hive 中的视图,出现以下异常:

Getting log thread is interrupted, since query is done!
Error: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=2)
java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
    at org.apache.hive.jdbc.HiveStatement.waitForOperationToComplete(HiveStatement.java:349)
    at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:251)
    at org.apache.hive.beeline.Commands.executeInternal(Commands.java:988)
    at org.apache.hive.beeline.Commands.execute(Commands.java:1160)
    at org.apache.hive.beeline.Commands.sql(Commands.java:1074)
    at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1145)
    at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:976)
    at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:886)
    at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:502)
    at org.apache.hive.beeline.BeeLine.main(BeeLine.java:485)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

这是我的蜂巢查询:

select * from sample_view;

我已将 SPARK_HOME/jars 路径添加到 $HIVE_HOME/bin/hive 中,例如:

for f in ${SPARK_HOME}/jars/*.jar; do
     CLASSPATH=${CLASSPATH}:$f;
done

我试过,hive.execution.engine 作为 mrspark,但没有运气。

请帮帮我。

TIA

【问题讨论】:

    标签: sql apache-spark hadoop hive views


    【解决方案1】:

    当我看到这是由于几个原因时,它可能是一个红鲱鱼错误,将多个批处理放在一起。在没有看到表 ddl 或执行程序日志的情况下,这是我能提供的最佳答案。

    (1) java 错误,导航到此作业实例的纱线日志并读取执行程序日志。如果这是因为一个相对罕见的错误而中断,你会在这里找到它。祝你好运,这可能会很痛苦。

    (2)后台服务器异常,重启hadoop和hive元素并重新运行命令。

    (3) 尝试在另一个进程中调用底层数据。这将查找数据是否与 ddl 不匹配或损坏。

    (4) 修复和失效表

    msck repair table <table-name>
    invalidate metadata <table-name>
    

    祝你好运。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多