public static void walkOperatorTree(ParseContext pctx, NodeProcessorCtx opWalkerCtx,
                                      SemanticNodeProcessor filterProc, SemanticNodeProcessor defaultProc) throws SemanticException {
    Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();

    // Build regular expression for operator rule.
    // "(TS%FIL%)|(TS%FIL%FIL%)"
    String tsOprName = TableScanOperator.getOperatorName();
    String filtOprName = FilterOperator.getOperatorName();

    opRules.put(new RuleExactMatch("R1", new String[] {tsOprName, filtOprName, filtOprName}), filterProc);
    opRules.put(new RuleExactMatch("R2", new String[] {tsOprName, filtOprName}), filterProc);

    // The dispatcher fires the processor corresponding to the closest matching
    // rule and passes the context along
    SemanticDispatcher disp = new DefaultRuleDispatcher(defaultProc, opRules, opWalkerCtx);
    SemanticGraphWalker ogw = new DefaultGraphWalker(disp);

    // Create a list of topop nodes
    ArrayList<Node> topNodes = new ArrayList<Node>();
    topNodes.addAll(pctx.getTopOps().values());
    ogw.startWalking(topNodes, null);
  }
Walk operator tree for pruner generation.

@param pctx
@param opWalkerCtx
@param filterProc
@param defaultProc
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/PrunerUtils.java