private void handleWork(TezWork tezWork, BaseWork work)
        throws SemanticException {
      Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();

      if (conf.getVar(HiveConf.ConfVars.LLAP_EXECUTION_MODE).equals("only")
          && !conf.getBoolVar(HiveConf.ConfVars.LLAP_ENABLE_GRACE_JOIN_IN_LLAP)) {
        // In LLAP only mode, grace hash join will be disabled later on by the LlapDispatcher anyway.
        // Since the presence of Grace Hash Join disables some "native" vectorization optimizations,
        // we will disable the grace hash join now, before vectorization is done.
        opRules.put(new RuleRegExp("Disable grace hash join if LLAP mode and not dynamic partition hash join",
            MapJoinOperator.getOperatorName() + "%"), new SemanticNodeProcessor() {
              @Override
              public Object process(Node n, Stack<Node> s, NodeProcessorCtx c, Object... os) {
                MapJoinOperator mapJoinOp = (MapJoinOperator) n;
                if (mapJoinOp.getConf().isHybridHashJoin() && !(mapJoinOp.getConf().isDynamicPartitionHashJoin())) {
                  mapJoinOp.getConf().setHybridHashJoin(false);
                }
                return Boolean.TRUE;
              }
            });
      }

      if (!opRules.isEmpty()) {
        SemanticDispatcher disp = new DefaultRuleDispatcher(null, opRules, null);
        SemanticGraphWalker ogw = new DefaultGraphWalker(disp);
        ArrayList<Node> topNodes = new ArrayList<Node>();
        topNodes.addAll(work.getAllRootOperators());
        ogw.startWalking(topNodes, null);
      }
    }
For any LLAP-related transformations which need to occur before vectorization.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapPreVectorizationPass.java