public static ExprNodeDesc genPruner(
      String tabAlias, ExprNodeDesc pred) throws SemanticException {
    // Create the walker, the rules dispatcher and the context.
    ExprProcCtx pprCtx = new ExprProcCtx(tabAlias);

    /* Move common logic to PrunerUtils.walkExprTree(...) so that it can be reused. */
    Map<Node, Object> outputMap = PrunerUtils.walkExprTree(pred, pprCtx, getColumnProcessor(),
        getFieldProcessor(), getGenericFuncProcessor(), getDefaultExprProcessor());

    // Get the exprNodeDesc corresponding to the first start node;
    return (ExprNodeDesc) outputMap.get(pred);
  }
Generates the partition pruner for the expression tree.

@param tabAlias
         The table alias of the partition table that is being considered
         for pruning
@param pred
         The predicate from which the partition pruner needs to be
         generated
@return The pruner expression.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/ExprProcFactory.java