Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ Task Failed Due to Concurrent Writes to One Table or Partition
Updated on 2022-12-09 GMT+08:00

Task Failed Due to Concurrent Writes to One Table or Partition

Symptom

When Hive executes an INSERT statement, an error is reported indicating that a file or directory already exists or is cleared in HDFS. The error details are as follows:

Cause Analysis

  1. Check the start time and end time of the task based on the HiveServer audit logs.
  2. Check whether data is inserted into the same table or partition in the time segment.
  3. Hive does not support concurrent data insertion for a table or partition. As a result, multiple tasks perform operations on the same temporary data directory, and one task moves the data of another task, causing task failure.

Solution

The service logic is modified so that data is inserted to the same table or partition in single thread mode.