@SuppressWarnings({"rawtypes", "unchecked"})
  private static Path createEmptyFile(Path hiveScratchDir,
      HiveOutputFormat outFileFormat, JobConf job,
      Properties props, boolean dummyRow)
          throws IOException, InstantiationException, IllegalAccessException {

    // create a dummy empty file in a new directory
    String newDir = hiveScratchDir + Path.SEPARATOR + UUID.randomUUID().toString();
    Path newPath = new Path(newDir);
    FileSystem fs = newPath.getFileSystem(job);
    fs.mkdirs(newPath);
    //Qualify the path against the file system. The user configured path might contain default port which is skipped
    //in the file status. This makes sure that all paths which goes into PathToPartitionInfo are always listed status
    //file path.
    newPath = fs.makeQualified(newPath);
    String newFile = newDir + Path.SEPARATOR + "emptyFile";
    Path newFilePath = new Path(newFile);

    RecordWriter recWriter = outFileFormat.getHiveRecordWriter(job, newFilePath,
        Text.class, false, props, null);
    if (dummyRow) {
      // empty files are omitted at CombineHiveInputFormat.
      // for meta-data only query, it effectively makes partition columns disappear..
      // this could be fixed by other methods, but this seemed to be the most easy (HIVEV-2955)
      recWriter.write(new Text("empty"));  // written via HiveIgnoreKeyTextOutputFormat
    }
    recWriter.close(false);

    return StringInternUtils.internUriStringsInPath(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