private static void setUnionPlan(GenMRProcContext opProcCtx,
      boolean local, Task<?> currTask, GenMRUnionCtx uCtx,
      boolean mergeTask) throws SemanticException {
    TableScanOperator currTopOp = opProcCtx.getCurrTopOp();

    if (currTopOp != null) {
      String currAliasId = opProcCtx.getCurrAliasId();
      if (mergeTask || !opProcCtx.isSeenOp(currTask, currTopOp)) {
        setTaskPlan(currAliasId, currTopOp, currTask, local, opProcCtx);
      }
      currTopOp = null;
      opProcCtx.setCurrTopOp(currTopOp);
    } else {
      List<String> taskTmpDirLst = uCtx.getTaskTmpDir();
      if ((taskTmpDirLst != null) && !(taskTmpDirLst.isEmpty())) {
        List<TableDesc> tt_descLst = uCtx.getTTDesc();
        assert !taskTmpDirLst.isEmpty() && !tt_descLst.isEmpty();
        assert taskTmpDirLst.size() == tt_descLst.size();
        int size = taskTmpDirLst.size();
        assert local == false;

        List<TableScanOperator> topOperators =
            uCtx.getListTopOperators();

        MapredWork plan = (MapredWork) currTask.getWork();
        for (int pos = 0; pos < size; pos++) {
          String taskTmpDir = taskTmpDirLst.get(pos);
          Path taskTmpDirPath = new Path(taskTmpDir);
          MapWork mWork = plan.getMapWork();
          if (!mWork.getPathToAliases().containsKey(taskTmpDirPath)) {
            taskTmpDir = taskTmpDir.intern();
            StringInternUtils.internUriStringsInPath(taskTmpDirPath);
            TableDesc tt_desc = tt_descLst.get(pos);
            mWork.addPathToAlias(taskTmpDirPath, taskTmpDir);
            mWork.addPathToPartitionInfo(taskTmpDirPath, new PartitionDesc(tt_desc, null));
            mWork.getAliasToWork().put(taskTmpDir, topOperators.get(pos));
          }
        }
      }
    }
  }
Initialize the current union plan.

@param op
         the reduce sink operator encountered
@param opProcCtx
         processing context
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java