public ExprNodeDesc analyzePredicate(
    ExprNodeDesc predicate,
    final List<IndexSearchCondition> searchConditions) {

    Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
    SemanticNodeProcessor nodeProcessor = new SemanticNodeProcessor() {
      @Override
      public Object process(Node nd, Stack<Node> stack,
                            NodeProcessorCtx procCtx, Object... nodeOutputs)
        throws SemanticException {

        // We can only push down stuff which appears as part of
        // a pure conjunction:  reject OR, CASE, etc.
        for (Node ancestor : stack) {
          if (nd == ancestor) {
            break;
          }
          if (!FunctionRegistry.isOpAnd((ExprNodeDesc) ancestor)) {
            return nd;
          }
        }

        if (nd instanceof ExprNodeGenericFuncDesc) {
          return analyzeExpr((ExprNodeGenericFuncDesc) nd, searchConditions, nodeOutputs);
        } else {
          return nd;
        }
      }
    };

    SemanticDispatcher disp = new DefaultRuleDispatcher(
      nodeProcessor, opRules, null);
    SemanticGraphWalker ogw = new DefaultGraphWalker(disp);
    ArrayList<Node> topNodes = new ArrayList<Node>();
    topNodes.add(predicate);
    HashMap<Node, Object> nodeOutput = new HashMap<Node, Object>();
    try {
      ogw.startWalking(topNodes, nodeOutput);
    } catch (SemanticException ex) {
      throw new RuntimeException(ex);
    }
    ExprNodeDesc residualPredicate = (ExprNodeDesc) nodeOutput.get(predicate);
    return residualPredicate;
  }
Analyzes a predicate.

@param predicate predicate to be analyzed

@param searchConditions receives conditions produced by analysis

@return residual predicate which could not be translated to
searchConditions
ql/src/java/org/apache/hadoop/hive/ql/index/IndexPredicateAnalyzer.java