Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ Error Message "Execution Error return code 2" Is Displayed When the SELECT Statement Is Executed
Updated on 2024-09-18 GMT+08:00

Error Message "Execution Error return code 2" Is Displayed When the SELECT Statement Is Executed

Symptom

When the select count(*) from XXX; statement is executed, the client reports the following error:

Error:Error while processing statement :FAILED:Execution Error,return code 2 from ...

return code 2 indicates that the task fails because an error is reported during the execution of the MapReduce task.

Cause Analysis

  1. Go to the native Yarn page to check the MapReduce task logs. The check result shows that the error occurs due to an unidentified compression mode. The file name suffix is .gzip but the stack reports .zlib.

  2. Therefore, the HDFS file corresponding to the table that is queried may be incorrect. According to the file name printed in the Map log, download the file from HDFS to the local end. The file suffixed with .gz fails to be decompressed by running the tar command because its format is incorrect. Run the file command to check the file property. The command output shows that the file is compressed from the FAT system instead of UNIX.

Solution

Delete the file with an incorrect format from the HDFS directory or replace it with a correct one.