Class PathInExpr
java.lang.Object
org.apache.drill.common.expression.visitors.AbstractExprVisitor<Boolean,Void,RuntimeException>
org.apache.drill.exec.planner.index.PathInExpr
- All Implemented Interfaces:
ExprVisitor<Boolean,
Void, RuntimeException>
Class PathInExpr is to recursively analyze a expression trees with a map of
indexed expression collected from indexDescriptor, e.g. Map 'cast(a.q as
int)' -> '$0' means the expression 'cast(a.q as int)' is named as '$0' in
index table.
for project expressions: cast(a.q as int), a.q, b + c, PathInExpr will get remainderPath {a.q, b, c}, which is helpful to determine if q query is covering. remainderPathsInFunction will be {a.q}, which will be used to decide if the {a.q} in scan column and project rowtype should be removed or not.
This class could be more generic to support any expression, for now it works for only 'cast(schemapath as type)'.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvisitCastExpression
(CastExpression castExpr, Void value) visitFunctionCall
(FunctionCall call, Void value) visitFunctionHolderExpression
(FunctionHolderExpression holder, Void value) visitIfExpression
(IfExpression ifExpr, Void value) visitSchemaPath
(SchemaPath path, Void value) visitUnknown
(LogicalExpression e, Void value) Handles implementation-specific expressions not known to the visitor structure.Methods inherited from class org.apache.drill.common.expression.visitors.AbstractExprVisitor
visitAnyValueExpression, visitBooleanConstant, visitBooleanOperator, visitConvertExpression, visitDateConstant, visitDecimal18Constant, visitDecimal28Constant, visitDecimal38Constant, visitDecimal9Constant, visitDoubleConstant, visitFloatConstant, visitIntConstant, visitIntervalDayConstant, visitIntervalYearConstant, visitLongConstant, visitNullConstant, visitNullExpression, visitParameter, visitQuotedStringConstant, visitTimeConstant, visitTimeStampConstant, visitTypedFieldExpr, visitVarDecimalConstant
-
Constructor Details
-
PathInExpr
-
-
Method Details
-
getRemainderPaths
-
getRemainderPathsInFunctions
-
visitFunctionCall
- Specified by:
visitFunctionCall
in interfaceExprVisitor<Boolean,
Void, RuntimeException> - Overrides:
visitFunctionCall
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-
visitFunctionHolderExpression
public Boolean visitFunctionHolderExpression(FunctionHolderExpression holder, Void value) throws RuntimeException - Specified by:
visitFunctionHolderExpression
in interfaceExprVisitor<Boolean,
Void, RuntimeException> - Overrides:
visitFunctionHolderExpression
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-
visitCastExpression
- Specified by:
visitCastExpression
in interfaceExprVisitor<Boolean,
Void, RuntimeException> - Overrides:
visitCastExpression
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-
visitIfExpression
- Specified by:
visitIfExpression
in interfaceExprVisitor<Boolean,
Void, RuntimeException> - Overrides:
visitIfExpression
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-
visitSchemaPath
- Specified by:
visitSchemaPath
in interfaceExprVisitor<Boolean,
Void, RuntimeException> - Overrides:
visitSchemaPath
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-
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<Boolean,
Void, RuntimeException> - Overrides:
visitUnknown
in classAbstractExprVisitor<Boolean,
Void, RuntimeException> - Throws:
RuntimeException
-