public static NodeInfoWrapper walkExprTree(
      String tabAlias, List<Partition> parts, List<VirtualColumn> vcs, ExprNodeDesc pred)
      throws SemanticException {
    // Create the walker, the rules dispatcher and the context.
    PcrExprProcCtx pprCtx = new PcrExprProcCtx(tabAlias, parts, vcs);

    Map<SemanticRule, SemanticNodeProcessor> exprRules = new LinkedHashMap<>();
    exprRules.put(
        new RuleRegExp("R1", ExprNodeColumnDesc.class.getName() + "%"),
        getColumnProcessor());
    exprRules.put(
        new RuleRegExp("R2", ExprNodeFieldDesc.class.getName() + "%"),
        getFieldProcessor());
    exprRules.put(new RuleRegExp("R5", ExprNodeGenericFuncDesc.class.getName()
        + "%"), getGenericFuncProcessor());

    // The dispatcher fires the processor corresponding to the closest matching
    // rule and passes the context along
    SemanticDispatcher disp = new DefaultRuleDispatcher(getDefaultExprProcessor(),
        exprRules, pprCtx);
    SemanticGraphWalker egw = new ExpressionWalker(disp);

    List<Node> startNodes = new ArrayList<>();
    startNodes.add(pred);

    HashMap<Node, Object> outputMap = new HashMap<>();
    egw.startWalking(startNodes, outputMap);

    // Return the wrapper of the root node
    return (NodeInfoWrapper) outputMap.get(pred);
  }
Remove partition conditions when necessary from the the expression tree.

@param tabAlias
         the table alias
@param parts
         the list of all pruned partitions for the table
@param vcs
         virtual columns referenced
@param pred
         expression tree of the target filter operator
@return the node information of the root expression
ql/src/java/org/apache/hadoop/hive/ql/optimizer/pcr/PcrExprProcFactory.java