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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies this shuttle to each expression in a list and returns the resulting list.final @PolyNull RexNodeApplies 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, waitMethods inherited from interface org.apache.calcite.rex.RexVisitor
visitEach, visitList, visitList
-
Constructor Details
-
RexShuttle
public RexShuttle()
-
-
Method Details
-
visitOver
- Specified by:
visitOverin interfaceRexVisitor<RexNode>
-
visitOverAggFunction
-
visitWindow
-
visitSubQuery
- Specified by:
visitSubQueryin interfaceRexVisitor<RexNode>
-
visitTableInputRef
- Specified by:
visitTableInputRefin interfaceRexVisitor<RexNode>
-
visitPatternFieldRef
- Specified by:
visitPatternFieldRefin interfaceRexVisitor<RexNode>
-
visitCall
- Specified by:
visitCallin 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:
visitCorrelVariablein interfaceRexVisitor<RexNode>
-
visitFieldAccess
- Specified by:
visitFieldAccessin interfaceRexVisitor<RexNode>
-
visitInputRef
- Specified by:
visitInputRefin interfaceRexVisitor<RexNode>
-
visitLocalRef
- Specified by:
visitLocalRefin interfaceRexVisitor<RexNode>
-
visitLiteral
- Specified by:
visitLiteralin interfaceRexVisitor<RexNode>
-
visitDynamicParam
- Specified by:
visitDynamicParamin interfaceRexVisitor<RexNode>
-
visitRangeRef
- Specified by:
visitRangeRefin interfaceRexVisitor<RexNode>
-
visitLambda
- Specified by:
visitLambdain interfaceRexVisitor<RexNode>
-
visitLambdaRef
- Specified by:
visitLambdaRefin 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
exprListis null. -
apply
Applies this shuttle to an expression, or returns null if the expression is null.
-