@SuppressWarnings("unchecked")
  private Operator<? extends OperatorDesc> getParentFromStack(Node currentMergeJoinOperator,
      Stack<Node> stack) {
    int pos = stack.indexOf(currentMergeJoinOperator);
    return (Operator<? extends OperatorDesc>) stack.get(pos - 1);
  }
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