public static Map<String, Integer> getDeltaToAttemptIdMap(
      Map<String, AcidInputFormat.DeltaMetaData> pathToDeltaMetaData, Path[] deleteDeltaDirs, int bucket) {
    Map<String, Integer> deltaToAttemptId = new HashMap<>();
    for (Path delta : deleteDeltaDirs) {
      AcidInputFormat.DeltaMetaData deltaMetaData = pathToDeltaMetaData.get(delta.getName());
      for (DeltaFileMetaData files : deltaMetaData.getDeltaFiles()) {
        if (bucket == files.getBucketId()) {
          deltaToAttemptId.put(delta.getName(), files.getAttemptId());
          break;
        }
      }
    }
    return deltaToAttemptId;
  }
If the direct insert is on for ACID tables, the files will contain an "_attemptID" postfix.
In order to be able to read the files from the delete deltas, we need to know which
attemptId belongs to which delta. To make this lookup easy, this method created a map
to link the deltas to the attemptId.
@param pathToDeltaMetaData
@param deleteDeltaDirs
@param bucket
@return
ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java