@SuppressWarnings("rawtypes")
  private static Path createDummyFileForEmptyPartition(Path path, JobConf job, PartitionDesc partDesc,
                                                       Path hiveScratchDir) throws Exception {

    String strPath = path.toString();

    // The input file does not exist, replace it by a empty file
    if (partDesc.getTableDesc().isNonNative()) {
      // if this isn't a hive table we can't create an empty file for it.
      return path;
    }

    Properties props = SerDeUtils.createOverlayedProperties(
        partDesc.getTableDesc().getProperties(), partDesc.getProperties());
    HiveOutputFormat outFileFormat = HiveFileFormatUtils.getHiveOutputFormat(job, partDesc);

    boolean oneRow = partDesc.getInputFileFormatClass() == OneNullRowInputFormat.class;

    Path newPath = createEmptyFile(hiveScratchDir, outFileFormat, job, props, oneRow);

    LOG.info("Changed input file {} to empty file {} ({})", strPath, newPath, oneRow);
    return newPath;
  }
Computes a list of all input paths needed to compute the given MapWork. All aliases
are considered and a merged list of input paths is returned. If any input path points
to an empty table or partition a dummy file in the scratch dir is instead created and
added to the list. This is needed to avoid special casing the operator pipeline for
these cases.

@param job JobConf used to run the job
@param work MapWork encapsulating the info about the task
@param hiveScratchDir The tmp dir used to create dummy files if needed
@param ctx Context object
@return List of paths to process for the given MapWork
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java