private static MapWork createMRWorkForMergingFiles (HiveConf conf,
    TableScanOperator topOp,  FileSinkDesc fsDesc) {

    ArrayList<String> aliases = new ArrayList<String>();
    Path inputDir = StringInternUtils.internUriStringsInPath(fsDesc.getMergeInputDirName());
    String inputDirStr = inputDir.toString().intern();
    TableDesc tblDesc = fsDesc.getTableInfo();
    aliases.add(inputDirStr); // dummy alias: just use the input path

    // constructing the default MapredWork
    MapredWork cMrPlan = GenMapRedUtils.getMapRedWorkFromConf(conf);
    MapWork cplan = cMrPlan.getMapWork();
    cplan.addPathToAlias(inputDir, aliases);
    cplan.addPathToPartitionInfo(inputDir, new PartitionDesc(tblDesc, null));
    cplan.getAliasToWork().put(inputDirStr, topOp);
    cplan.setMapperCannotSpanPartns(true);

    return cplan;
  }
Create a MapredWork based on input path, the top operator and the input
table descriptor.

@param conf
@param topOp
         the table scan operator that is the root of the MapReduce task.
@param fsDesc
         the file sink descriptor that serves as the input to this merge task.
@param parentMR
         the parent MapReduce work
@param parentFS
         the last FileSinkOperator in the parent MapReduce work
@return the MapredWork
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java