Package org.apache.calcite.rel.rules
Class PushProjector.RefAndExprConverter
- java.lang.Object
-
- org.apache.calcite.rex.RexShuttle
-
- org.apache.calcite.plan.RelOptUtil.RexInputConverter
-
- org.apache.calcite.rel.rules.PushProjector.RefAndExprConverter
-
- All Implemented Interfaces:
RexVisitor<RexNode>
- Enclosing class:
- PushProjector
private class PushProjector.RefAndExprConverter extends RelOptUtil.RexInputConverter
Walks an expression tree, replacing input refs with new values to reflect projection and converting special expressions to field references.
-
-
Field Summary
Fields Modifier and Type Field Description private int
firstLeftRef
private int
firstRightRef
private java.util.List<RexNode>
preserveLeft
private java.util.List<RexNode>
preserveRight
-
Fields inherited from class org.apache.calcite.plan.RelOptUtil.RexInputConverter
destFields, rexBuilder
-
-
Constructor Summary
Constructors Constructor Description RefAndExprConverter(RexBuilder rexBuilder, java.util.List<RelDataTypeField> srcFields, java.util.List<RelDataTypeField> destFields, int[] adjustments, java.util.List<RexNode> preserveLeft, int firstLeftRef, java.util.List<RexNode> preserveRight, int firstRightRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
findExprInLists(RexNode rex, java.util.List<RexNode> rexList1, int adjust1, java.util.List<RexNode> rexList2, int adjust2)
Looks for a matching RexNode from among two lists of RexNodes and returns the offset into the list corresponding to the match, adjusted by an amount, depending on whether the match was from the first or second list.RexNode
visitCall(RexCall call)
-
Methods inherited from class org.apache.calcite.plan.RelOptUtil.RexInputConverter
visitInputRef
-
Methods inherited from class org.apache.calcite.rex.RexShuttle
apply, apply, apply, mutate, visitArray, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitFieldCollations, visitList, visitList, visitLiteral, visitLocalRef, visitOver, visitPatternFieldRef, visitRangeRef, visitSubQuery, visitTableInputRef, visitWindow
-
-
-
-
Constructor Detail
-
RefAndExprConverter
RefAndExprConverter(RexBuilder rexBuilder, java.util.List<RelDataTypeField> srcFields, java.util.List<RelDataTypeField> destFields, int[] adjustments, java.util.List<RexNode> preserveLeft, int firstLeftRef, java.util.List<RexNode> preserveRight, int firstRightRef)
-
-
Method Detail
-
visitCall
public RexNode visitCall(RexCall call)
- Specified by:
visitCall
in interfaceRexVisitor<RexNode>
- Overrides:
visitCall
in classRexShuttle
-
findExprInLists
private int findExprInLists(RexNode rex, java.util.List<RexNode> rexList1, int adjust1, java.util.List<RexNode> rexList2, int adjust2)
Looks for a matching RexNode from among two lists of RexNodes and returns the offset into the list corresponding to the match, adjusted by an amount, depending on whether the match was from the first or second list.- Parameters:
rex
- RexNode that is being matched againstrexList1
- first list of RexNodesadjust1
- adjustment if match occurred in first listrexList2
- second list of RexNodesadjust2
- adjustment if match occurred in the second list- Returns:
- index in the list corresponding to the matching RexNode; -1 if no match
-
-