Package org.apache.drill.exec.expr
Class FilterBuilder
java.lang.Object
org.apache.drill.common.expression.visitors.AbstractExprVisitor<LogicalExpression,Set<LogicalExpression>,RuntimeException>
org.apache.drill.exec.expr.FilterBuilder
- All Implemented Interfaces:
ExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
public class FilterBuilder
extends AbstractExprVisitor<LogicalExpression,Set<LogicalExpression>,RuntimeException>
A visitor which visits a materialized logical expression, and build
FilterPredicate If a visitXXX method returns null, that means the
corresponding filter branch is not qualified for push down.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FilterPredicate<?>
buildFilterPredicate
(LogicalExpression expr, Set<LogicalExpression> constantBoundaries, UdfUtilities udfUtilities, boolean omitUnsupportedExprs) visitBooleanConstant
(ValueExpressions.BooleanExpression booleanExpression, Set<LogicalExpression> value) visitBooleanOperator
(BooleanOperator op, Set<LogicalExpression> value) visitDateConstant
(ValueExpressions.DateExpression dateExpr, Set<LogicalExpression> value) visitDoubleConstant
(ValueExpressions.DoubleExpression dExpr, Set<LogicalExpression> value) visitFloatConstant
(ValueExpressions.FloatExpression fExpr, Set<LogicalExpression> value) visitFunctionHolderExpression
(FunctionHolderExpression funcHolderExpr, Set<LogicalExpression> value) visitIntConstant
(ValueExpressions.IntExpression intExpr, Set<LogicalExpression> value) visitLongConstant
(ValueExpressions.LongExpression intExpr, Set<LogicalExpression> value) visitQuotedStringConstant
(ValueExpressions.QuotedString quotedString, Set<LogicalExpression> value) visitTimeConstant
(ValueExpressions.TimeExpression timeExpr, Set<LogicalExpression> value) visitTypedFieldExpr
(TypedFieldExpr typedFieldExpr, Set<LogicalExpression> value) visitUnknown
(LogicalExpression e, Set<LogicalExpression> value) Handles implementation-specific expressions not known to the visitor structure.visitVarDecimalConstant
(ValueExpressions.VarDecimalExpression decExpr, Set<LogicalExpression> value) Methods inherited from class org.apache.drill.common.expression.visitors.AbstractExprVisitor
visitAnyValueExpression, visitCastExpression, visitConvertExpression, visitDecimal18Constant, visitDecimal28Constant, visitDecimal38Constant, visitDecimal9Constant, visitFunctionCall, visitIfExpression, visitIntervalDayConstant, visitIntervalYearConstant, visitNullConstant, visitNullExpression, visitParameter, visitSchemaPath
-
Method Details
-
buildFilterPredicate
public static FilterPredicate<?> buildFilterPredicate(LogicalExpression expr, Set<LogicalExpression> constantBoundaries, UdfUtilities udfUtilities, boolean omitUnsupportedExprs) - Parameters:
expr
- materialized filter expressionconstantBoundaries
- set of constant expressionsudfUtilities
- udf utilities- Returns:
- metadata filter predicate
-
visitUnknown
Description copied from class:AbstractExprVisitor
Handles implementation-specific expressions not known to the visitor structure. Since there are no "visitFoo" methods for these "unknown" expressions, subclassses should use the functionally-equivalentinstanceof
approach to parse out these "unknown" expressions.- Specified by:
visitUnknown
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitUnknown
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitTypedFieldExpr
public LogicalExpression visitTypedFieldExpr(TypedFieldExpr typedFieldExpr, Set<LogicalExpression> value) - Specified by:
visitTypedFieldExpr
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitTypedFieldExpr
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitIntConstant
public LogicalExpression visitIntConstant(ValueExpressions.IntExpression intExpr, Set<LogicalExpression> value) - Specified by:
visitIntConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitIntConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitDoubleConstant
public LogicalExpression visitDoubleConstant(ValueExpressions.DoubleExpression dExpr, Set<LogicalExpression> value) - Specified by:
visitDoubleConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitDoubleConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitFloatConstant
public LogicalExpression visitFloatConstant(ValueExpressions.FloatExpression fExpr, Set<LogicalExpression> value) - Specified by:
visitFloatConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitFloatConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitLongConstant
public LogicalExpression visitLongConstant(ValueExpressions.LongExpression intExpr, Set<LogicalExpression> value) - Specified by:
visitLongConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitLongConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitVarDecimalConstant
public LogicalExpression visitVarDecimalConstant(ValueExpressions.VarDecimalExpression decExpr, Set<LogicalExpression> value) - Specified by:
visitVarDecimalConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitVarDecimalConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitDateConstant
public LogicalExpression visitDateConstant(ValueExpressions.DateExpression dateExpr, Set<LogicalExpression> value) - Specified by:
visitDateConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitDateConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitTimeStampConstant
public LogicalExpression visitTimeStampConstant(ValueExpressions.TimeStampExpression tsExpr, Set<LogicalExpression> value) - Specified by:
visitTimeStampConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitTimeStampConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitTimeConstant
public LogicalExpression visitTimeConstant(ValueExpressions.TimeExpression timeExpr, Set<LogicalExpression> value) - Specified by:
visitTimeConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitTimeConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitBooleanConstant
public LogicalExpression visitBooleanConstant(ValueExpressions.BooleanExpression booleanExpression, Set<LogicalExpression> value) - Specified by:
visitBooleanConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitBooleanConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitQuotedStringConstant
public LogicalExpression visitQuotedStringConstant(ValueExpressions.QuotedString quotedString, Set<LogicalExpression> value) - Specified by:
visitQuotedStringConstant
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitQuotedStringConstant
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitBooleanOperator
- Specified by:
visitBooleanOperator
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitBooleanOperator
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-
visitFunctionHolderExpression
public LogicalExpression visitFunctionHolderExpression(FunctionHolderExpression funcHolderExpr, Set<LogicalExpression> value) - Specified by:
visitFunctionHolderExpression
in interfaceExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException> - Overrides:
visitFunctionHolderExpression
in classAbstractExprVisitor<LogicalExpression,
Set<LogicalExpression>, RuntimeException>
-