@Override
    public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs)
        throws SemanticException {
      ParseContext pCtx = ((OptimizeTezProcContext) procCtx).parseContext;
      planMapper = pCtx.getContext().getPlanMapper();
      if (nd instanceof ReduceSinkOperator) {
        ReduceSinkOperator rs = (ReduceSinkOperator) nd;
        SemiJoinBranchInfo sjInfo = pCtx.getRsToSemiJoinBranchInfo().get(rs);
        if (sjInfo == null) {
          return null;
        }
        walkSubtree(sjInfo.getTsOp());
      }
      if (nd instanceof AppMasterEventOperator) {
        AppMasterEventOperator ame = (AppMasterEventOperator) nd;
        AppMasterEventDesc c = ame.getConf();
        if (c instanceof DynamicPruningEventDesc) {
          DynamicPruningEventDesc dped = (DynamicPruningEventDesc) c;
          mark(dped.getTableScan());
        }
      }
      if (nd instanceof TableScanOperator) {
        // If the tablescan operator is making use of filtering capabilities of readers then
        // we will not see the actual incoming rowcount which was processed - so we may not use it for relNodes
        TableScanOperator ts = (TableScanOperator) nd;
        if (ts.getConf().getPredicateString() != null) {
          planMapper.link(ts, new OperatorStats.MayNotUseForRelNodes());
        }
      }
      return null;
    }
TezCompiler translates the operator plan into TezTasks.
ql/src/java/org/apache/hadoop/hive/ql/parse/TezCompiler.java