private static void processForWriteIdsForMmRead(Path dir, Configuration conf,
      ValidWriteIdList validWriteIdList, boolean allowOriginals, List<Path> finalPaths,
      List<Path> pathsWithFileOriginals) throws IOException {
    FileSystem fs = dir.getFileSystem(conf);
    Utilities.FILE_OP_LOGGER.trace("Checking {} for inputs", dir);

    // Ignore nullscan-optimized paths.
    if (fs instanceof NullScanFileSystem) {
      finalPaths.add(dir);
      return;
    }

    // We need to iterate to detect original directories, that are supported in MM but not ACID.
    boolean hasOriginalFiles = false, hasAcidDirs = false;
    List<Path> originalDirectories = new ArrayList<>();
    for (FileStatus file : fs.listStatus(dir, FileUtils.HIDDEN_FILES_PATH_FILTER)) {
      Path currDir = file.getPath();
      Utilities.FILE_OP_LOGGER.trace("Checking {} for being an input", currDir);
      if (!file.isDirectory()) {
        hasOriginalFiles = true;
      } else if (AcidUtils.extractWriteId(currDir) == null) {
        if (allowOriginals) {
          originalDirectories.add(currDir); // Add as is; it would become a recursive split.
        } else {
          Utilities.FILE_OP_LOGGER.debug("Ignoring unknown (original?) directory {}", currDir);
        }
      } else {
        hasAcidDirs = true;
      }
    }
    if (hasAcidDirs) {
      AcidDirectory dirInfo = AcidUtils.getAcidState(
          fs, dir, conf, validWriteIdList, Ref.from(false), true);

      // Find the base, created for IOW.
      Path base = dirInfo.getBaseDirectory();
      if (base != null) {
        Utilities.FILE_OP_LOGGER.debug("Adding input {}", base);
        finalPaths.add(base);
        // Base means originals no longer matter.
        originalDirectories.clear();
        hasOriginalFiles = false;
      }

      // Find the parsed delta files.
      for (AcidUtils.ParsedDelta delta : dirInfo.getCurrentDirectories()) {
        Utilities.FILE_OP_LOGGER.debug("Adding input {}", delta.getPath());
        finalPaths.add(delta.getPath());
      }
    }
    if (!originalDirectories.isEmpty()) {
      Utilities.FILE_OP_LOGGER.debug("Adding original directories {}", originalDirectories);
      finalPaths.addAll(originalDirectories);
    }
    if (hasOriginalFiles) {
      if (allowOriginals) {
        Utilities.FILE_OP_LOGGER.debug("Directory has original files {}", dir);
        pathsWithFileOriginals.add(dir);
      } else {
        Utilities.FILE_OP_LOGGER.debug("Ignoring unknown (original?) files in {}", dir);
      }
    }
  }
NOTE: this no longer wraps the IF for LLAP. Call wrapForLlap manually if needed.
ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java