private static void getChildState(AcidDirectory directory, Map<Path, HdfsDirSnapshot> dirSnapshots,
      ValidWriteIdList writeIdList, ValidTxnList validTxnList , boolean ignoreEmptyFiles) throws IOException {
    for (HdfsDirSnapshot dirSnapshot : dirSnapshots.values()) {
      Path dirPath = dirSnapshot.getPath();
      String dirName = dirPath.getName();
      // dirPath may contains the filesystem prefix
      if (dirPath.toString().endsWith(directory.getPath().toString())) {
        // if the candidateDirectory is itself a delta directory, we need to add originals in that directory
        // and return. This is the case when compaction thread calls getChildState.
        for (FileStatus fileStatus : dirSnapshot.getFiles()) {
          if (!ignoreEmptyFiles || fileStatus.getLen() != 0) {
            directory.getOriginalFiles().add(new HdfsFileStatusWithoutId(fileStatus));
          }
        }
      } else if (dirName.startsWith(BASE_PREFIX)) {
        processBaseDir(dirPath, writeIdList, validTxnList, directory, dirSnapshot);
      } else if (dirName.startsWith(DELTA_PREFIX) || dirName.startsWith(DELETE_DELTA_PREFIX)) {
        processDeltaDir(dirPath, writeIdList, validTxnList, directory, dirSnapshot);
      } else {
        directory.getOriginalDirectories().add(dirPath);
        for (FileStatus stat : dirSnapshot.getFiles()) {
          if ((!ignoreEmptyFiles) || (stat.getLen() != 0)) {
            directory.getOriginalFiles().add(new HdfsFileStatusWithoutId(stat));
          }
        }
      }
    }
  }
Returns {@code true} if {@code parsedBase} was created by compaction.
As of Hive 4.0 we can tell if a directory is a result of compaction based on the
presence of {@link AcidUtils#VISIBILITY_PATTERN} suffix.  Base directories written prior to
that, have to rely on the {@link MetaDataFile} in the directory. So look at the filename first
since that is the cheaper test.
ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java