public class IndexPredicateAnalyzer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
IndexPredicateAnalyzer.FieldValidator |
Constructor and Description |
---|
IndexPredicateAnalyzer() |
Modifier and Type | Method and Description |
---|---|
void |
addComparisonOp(String udfName)
Registers a comparison operator as one which can be satisfied
by an index search.
|
void |
addComparisonOp(String columnName,
String... udfs)
add allowed functions per column
|
void |
allowColumnName(String columnName)
Adds a column name to the set of column names allowed.
|
ExprNodeDesc |
analyzePredicate(ExprNodeDesc predicate,
List<IndexSearchCondition> searchConditions)
Analyzes a predicate.
|
void |
clearAllowedColumnNames()
Clears the set of column names allowed in comparisons.
|
static IndexPredicateAnalyzer |
createAnalyzer(boolean equalOnly) |
void |
setAcceptsFields(boolean acceptsFields) |
void |
setFieldValidator(IndexPredicateAnalyzer.FieldValidator fieldValidator) |
ExprNodeGenericFuncDesc |
translateSearchConditions(List<IndexSearchCondition> searchConditions)
Translates search conditions back to ExprNodeDesc form (as
a left-deep conjunction).
|
public void setFieldValidator(IndexPredicateAnalyzer.FieldValidator fieldValidator)
public void addComparisonOp(String udfName)
udfName
- name of comparison operator as returned
by either GenericUDFBridge.getUdfName()
(for simple UDF's)
or udf.getClass().getName() (for generic UDF's).public void clearAllowedColumnNames()
public void allowColumnName(String columnName)
columnName
- name of column to be allowedpublic void addComparisonOp(String columnName, String... udfs)
columnName
- udfs
- public ExprNodeDesc analyzePredicate(ExprNodeDesc predicate, List<IndexSearchCondition> searchConditions)
predicate
- predicate to be analyzedsearchConditions
- receives conditions produced by analysispublic ExprNodeGenericFuncDesc translateSearchConditions(List<IndexSearchCondition> searchConditions)
searchConditions
- (typically produced by analyzePredicate)public void setAcceptsFields(boolean acceptsFields)
public static IndexPredicateAnalyzer createAnalyzer(boolean equalOnly)
Copyright © 2017 The Apache Software Foundation. All rights reserved.