use of org.apache.phoenix.hive.ql.index.IndexPredicateAnalyzer in project phoenix by apache.
the class PhoenixPredicateDecomposer method decomposePredicate.
public DecomposedPredicate decomposePredicate(ExprNodeDesc predicate) {
if (LOG.isDebugEnabled()) {
LOG.debug("predicate - " + predicate.toString());
}
IndexPredicateAnalyzer analyzer = PredicateAnalyzerFactory.createPredicateAnalyzer(columnNameList, getFieldValidator());
DecomposedPredicate decomposed = new DecomposedPredicate();
List<IndexSearchCondition> conditions = new ArrayList<IndexSearchCondition>();
decomposed.residualPredicate = (ExprNodeGenericFuncDesc) analyzer.analyzePredicate(predicate, conditions);
if (!conditions.isEmpty()) {
decomposed.pushedPredicate = analyzer.translateSearchConditions(conditions);
try {
searchConditionList = conditions;
calledPPD = true;
} catch (Exception e) {
LOG.warn("Failed to decompose predicates", e);
return null;
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("decomposed predicate - residualPredicate: " + decomposed.residualPredicate + ", pushedPredicate: " + decomposed.pushedPredicate);
}
return decomposed;
}
Aggregations