private synchronized void processPath(MapWork work, Path path, Collection<String> aliasesToOptimize,
                                        boolean isEmpty) {
    PartitionDesc partDesc = work.getPathToPartitionInfo().get(path).clone();
    partDesc.setInputFileFormatClass(isEmpty ? ZeroRowsInputFormat.class : OneNullRowInputFormat.class);
    partDesc.setOutputFileFormatClass(HiveIgnoreKeyTextOutputFormat.class);
    partDesc.getProperties().setProperty(serdeConstants.SERIALIZATION_LIB,
        NullStructSerDe.class.getName());
    Path fakePath =
        new Path(NullScanFileSystem.getBase() + partDesc.getTableName()
            + "/part" + encode(partDesc.getPartSpec()));
    StringInternUtils.internUriStringsInPath(fakePath);
    work.addPathToPartitionInfo(fakePath, partDesc);
    work.addPathToAlias(fakePath, new ArrayList<>(aliasesToOptimize));
    Collection<String> aliasesContainingPath = work.getPathToAliases().get(path);
    aliasesContainingPath.removeAll(aliasesToOptimize);
    if (aliasesContainingPath.isEmpty()) {
      work.removePathToAlias(path);
      work.removePathToPartitionInfo(path);
    }
  }
Iterate over all tasks one by one and removes all input paths from task if
conditions as defined in rules match.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java