@Override
  public ParseContext transform(ParseContext pctx) throws SemanticException {

    boolean enabled = false;
    String queryEngine = pctx.getConf().getVar(ConfVars.HIVE_EXECUTION_ENGINE);

    if (queryEngine.equals("tez")
        && pctx.getConf().getBoolVar(ConfVars.TEZ_DYNAMIC_PARTITION_PRUNING)) {
      enabled = true;
    }

    if (!enabled) {
      return pctx;
    }

    Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
    opRules.put(new RuleRegExp("R1", "(" +
        TableScanOperator.getOperatorName() + "%" + ".*" +
        ReduceSinkOperator.getOperatorName() + "%" +
        JoinOperator.getOperatorName() + "%)"), new JoinSynthetic());

    // The dispatcher fires the processor corresponding to the closest matching
    // rule and passes the context along
    SyntheticContext context = new SyntheticContext(pctx);
    SemanticDispatcher disp = new DefaultRuleDispatcher(null, opRules, context);
    PreOrderOnceWalker ogw = new PreOrderOnceWalker(disp);
    // The PreOrderOnceWalker traversal tries to cover all possible paths from the root to every other node. A plan
    // graph with lateral view operators has a particular structure that makes the number of paths exponentially big
    // and the traversal of such graphs prohibitively expensive. For this reason, we exclude lateral view operators
    // from the traversal and essentially disable the synthetic predicate generation for such branches.
    ogw.excludeNode(LateralViewForwardOperator.class);
    // Create a list of top op nodes
    List<Node> topNodes = new ArrayList<Node>();
    topNodes.addAll(pctx.getTopOps().values());
    ogw.startWalking(topNodes, null);

    return pctx;
  }
creates synthetic predicates that represent "IN (keylist other table)"
ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java