Package org.apache.calcite.rex
Class RexShuttle
java.lang.Object
org.apache.calcite.rex.RexShuttle
- All Implemented Interfaces:
RexVisitor<RexNode>
- Direct Known Subclasses:
ProjectCorrelateTransposeRule.RexFieldAccessReplacer
,ReduceDecimalsRule.DecimalShuttle
,ReduceExpressionsRule.CaseShuttle
,ReduceExpressionsRule.RexReplacer
,RelOptUtil.InputReferencedVisitor
,RelOptUtil.RexInputConverter
,RelOptUtil.VariableUsedVisitor
,RexPermutationShuttle
,RexPermuteInputsShuttle
,RexUtil.ExprSimplifier
,RexUtil.FixNullabilityShuttle
Passes over a row-expression, calling a handler method for each node,
appropriate to the type of the node.
Like RexVisitor
, this is an instance of the
Visitor Pattern
. Use
RexShuttle
if you would like your methods to return a
value.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionApplies this shuttle to each expression in a list and returns the resulting list.final @PolyNull RexNode
Applies this shuttle to an expression, or returns null if the expression is null.final <T extends @Nullable RexNode>
booleanApplies this shuttle to each expression in a list.protected RexNode[]
visitArray
(RexNode[] exprs, boolean @Nullable [] update) Visits each of an array of expressions and returns an array of the results.visitCorrelVariable
(RexCorrelVariable variable) visitDynamicParam
(RexDynamicParam dynamicParam) visitFieldAccess
(RexFieldAccess fieldAccess) protected List<RexFieldCollation>
visitFieldCollations
(List<RexFieldCollation> collations, boolean @Nullable [] update) Visits each of a list of field collations and returns a list of the results.visitInputRef
(RexInputRef inputRef) visitLambda
(RexLambda lambda) visitLambdaRef
(RexLambdaRef lambdaRef) Visits each of a list of expressions and returns a list of the results.visitLiteral
(RexLiteral literal) visitLocalRef
(RexLocalRef localRef) visitPatternFieldRef
(RexPatternFieldRef fieldRef) visitRangeRef
(RexRangeRef rangeRef) visitSubQuery
(RexSubQuery subQuery) visitWindow
(RexWindow window) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.rex.RexVisitor
visitEach, visitList, visitList
-
Constructor Details
-
RexShuttle
public RexShuttle()
-
-
Method Details
-
visitOver
- Specified by:
visitOver
in interfaceRexVisitor<RexNode>
-
visitOverAggFunction
-
visitWindow
-
visitSubQuery
- Specified by:
visitSubQuery
in interfaceRexVisitor<RexNode>
-
visitTableInputRef
- Specified by:
visitTableInputRef
in interfaceRexVisitor<RexNode>
-
visitPatternFieldRef
- Specified by:
visitPatternFieldRef
in interfaceRexVisitor<RexNode>
-
visitCall
- Specified by:
visitCall
in interfaceRexVisitor<RexNode>
-
visitArray
Visits each of an array of expressions and returns an array of the results.- Parameters:
exprs
- Array of expressionsupdate
- If not null, sets this to true if any of the expressions was modified- Returns:
- Array of visited expressions
-
visitList
Visits each of a list of expressions and returns a list of the results.- Parameters:
exprs
- List of expressionsupdate
- If not null, sets this to true if any of the expressions was modified- Returns:
- Array of visited expressions
-
visitFieldCollations
protected List<RexFieldCollation> visitFieldCollations(List<RexFieldCollation> collations, boolean @Nullable [] update) Visits each of a list of field collations and returns a list of the results.- Parameters:
collations
- List of field collationsupdate
- If not null, sets this to true if any of the expressions was modified- Returns:
- Array of visited field collations
-
visitCorrelVariable
- Specified by:
visitCorrelVariable
in interfaceRexVisitor<RexNode>
-
visitFieldAccess
- Specified by:
visitFieldAccess
in interfaceRexVisitor<RexNode>
-
visitInputRef
- Specified by:
visitInputRef
in interfaceRexVisitor<RexNode>
-
visitLocalRef
- Specified by:
visitLocalRef
in interfaceRexVisitor<RexNode>
-
visitLiteral
- Specified by:
visitLiteral
in interfaceRexVisitor<RexNode>
-
visitDynamicParam
- Specified by:
visitDynamicParam
in interfaceRexVisitor<RexNode>
-
visitRangeRef
- Specified by:
visitRangeRef
in interfaceRexVisitor<RexNode>
-
visitLambda
- Specified by:
visitLambda
in interfaceRexVisitor<RexNode>
-
visitLambdaRef
- Specified by:
visitLambdaRef
in interfaceRexVisitor<RexNode>
-
mutate
Applies this shuttle to each expression in a list.- Returns:
- whether any of the expressions changed
-
apply
Applies this shuttle to each expression in a list and returns the resulting list. Does not modify the initial list.Returns null if and only if
exprList
is null. -
apply
Applies this shuttle to an expression, or returns null if the expression is null.
-