private void processSubQueryUnionCreateIntermediate(
      Operator<? extends OperatorDesc> parent,
      Operator<? extends OperatorDesc> child,
      Task<?> uTask, GenMRProcContext ctx,
      GenMRUnionCtx uCtxTask) {
    ParseContext parseCtx = ctx.getParseCtx();

    TableDesc tt_desc = PlanUtils.getIntermediateFileTableDesc(PlanUtils
        .getFieldSchemasFromRowSchema(
            parent.getSchema(), "temporarycol"));

    // generate the temporary file
    Context baseCtx = parseCtx.getContext();
    Path taskTmpDir = baseCtx.getMRTmpPath();

    // Create the temporary file, its corresponding FileSinkOperaotr, and
    // its corresponding TableScanOperator.
    TableScanOperator tableScanOp =
        GenMapRedUtils.createTemporaryFile(parent, child, taskTmpDir, tt_desc, parseCtx);

    // Add the path to alias mapping
    uCtxTask.addTaskTmpDir(taskTmpDir.toUri().toString());
    uCtxTask.addTTDesc(tt_desc);
    uCtxTask.addListTopOperators(tableScanOp);

    // The union task is empty. The files created for all the inputs are
    // assembled in the union context and later used to initialize the union
    // plan

    Task<?> currTask = ctx.getCurrTask();
    currTask.addDependentTask(uTask);
    if (ctx.getRootTasks().contains(uTask)) {
      ctx.getRootTasks().remove(uTask);
      if (!ctx.getRootTasks().contains(currTask) &&
          shouldBeRootTask(currTask)) {
        ctx.getRootTasks().add(currTask);
      }
    }
  }
Process the union when the parent is a map-reduce job. Create a temporary
output, and let the union task read from the temporary output.

The files created for all the inputs are in the union context and later
used to initialize the union plan

@param parent
@param child
@param uTask
@param ctx
@param uCtxTask
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRUnion1.java