Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ An Error Is Reported When the select Statement Is Executed
Updated on 2022-09-14 GMT+08:00

An Error Is Reported When the select Statement Is Executed

Symptom

When the select count(*) from XXX statement is executed, the client reports the 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 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 whose name is 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.