dataengref errors

Home / Hive / Resources and memory

Hive: FAILED: Execution Error, return code 2 from TezTask or MapRedTask

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask

The query compiled but the job it launched failed. Return code 2 means the Tez DAG or MapReduce job failed at run time. The message itself carries no cause: the reason is in the Tez or YARN task logs.

Causes · Fixes · Source

Common causes

  1. Tasks ran out of memory (container killed or Java heap space).How to confirm: Open the failed application in the YARN UI or run yarn logs -applicationId <id> and search for "OutOfMemoryError" or "killed".
  2. Bad input data: a corrupt file, wrong format or a SerDe that cannot parse a row.How to confirm: The task log shows an exception from a reader or SerDe with a file path.
  3. Data skew: one reducer processes most of the data and times out or runs out of memory.How to confirm: One task runs far longer than the others in the Tez or YARN UI.

How to fix it

Read the task log of the first failed attempt and fix that error; the return code only says that the job failed.

For memory failures, raise the container size and Java heap together.

SettingDefaultNote
hive.tez.container.size-1in MB
hive.tez.java.optsnone

Where the message comes from

Message template in the source: FAILED: Execution Error, return code %d from %s

References

Related errors

Last checked: