简体   繁体   中英

Getting FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask exception while access Hive views

I am trying to access the views in Hive, getting following Exception:

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)

Here is my hive query:

select * from sample_view;

I have added SPARK_HOME/jars path to $HIVE_HOME/bin/hive like:

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

i have tried, hive.execution.engine as mr and as well as spark , but no luck.

Please help me out.

TIA

When I have seen this is because of a few reasons, it can be a red herring error that batches multiple ones together. Without seeing the table ddl or the executor logs this is the best answer I can offer.

(1) java error, navigate to the yarn logs for this job instance and read the executor logs. If this broke because of a relatively rare error you will find it here. Good luck this can be painful.

(2) background server is aberrant, restart the hadoop and hive elements and rerun command.

(3) try to call the underlying data in another process. This will find if the data doesn't match the ddl or corrupted.

(4) repair and invalidate table

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

Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM