private void connectUnionWorkWithWork(UnionWork unionWork, BaseWork work, TezWork tezWork,
      GenTezProcContext context) {
    LOG.debug("Connecting union work (" + unionWork + ") with work (" + work + ")");
    TezEdgeProperty edgeProp = new TezEdgeProperty(EdgeType.CONTAINS);
    tezWork.connect(unionWork, work, edgeProp);
    unionWork.addUnionOperators(context.currentUnionOperators);
    context.workWithUnionOperators.add(work);
  }
GenTezWork separates the operator tree into tez tasks.
It is called once per leaf operator (operator that forces
a new execution unit.) and break the operators into work
and tasks along the way.
ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezWork.java