Package org.apache.calcite.rex
Class RexPermuteInputsShuttle
- java.lang.Object
-
- org.apache.calcite.rex.RexShuttle
-
- org.apache.calcite.rex.RexPermuteInputsShuttle
-
- All Implemented Interfaces:
RexVisitor<RexNode>
public class RexPermuteInputsShuttle extends RexShuttle
Shuttle which applies a permutation to its input fields.
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<RelDataTypeField>
fields
private Mappings.TargetMapping
mapping
-
Constructor Summary
Constructors Modifier Constructor Description private
RexPermuteInputsShuttle(Mappings.TargetMapping mapping, com.google.common.collect.ImmutableList<RelDataTypeField> fields)
RexPermuteInputsShuttle(Mappings.TargetMapping mapping, RelNode... inputs)
Creates a RexPermuteInputsShuttle.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static com.google.common.collect.ImmutableList<RelDataTypeField>
fields(RelNode[] inputs)
private static int
lookup(java.util.List<RelDataTypeField> fields, java.lang.String name)
static RexPermuteInputsShuttle
of(Mappings.TargetMapping mapping)
Creates a shuttle with an empty field list.RexNode
visitCall(RexCall call)
RexNode
visitInputRef(RexInputRef local)
-
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
-
-
-
-
Field Detail
-
mapping
private final Mappings.TargetMapping mapping
-
fields
private final com.google.common.collect.ImmutableList<RelDataTypeField> fields
-
-
Constructor Detail
-
RexPermuteInputsShuttle
public RexPermuteInputsShuttle(Mappings.TargetMapping mapping, RelNode... inputs)
Creates a RexPermuteInputsShuttle.The mapping provides at most one target for every source. If a source has no targets and is referenced in the expression,
Mappings.TargetMapping.getTarget(int)
will give an error. Otherwise the mapping gives a unique target.- Parameters:
mapping
- Mappinginputs
- Input relational expressions
-
RexPermuteInputsShuttle
private RexPermuteInputsShuttle(Mappings.TargetMapping mapping, com.google.common.collect.ImmutableList<RelDataTypeField> fields)
-
-
Method Detail
-
of
public static RexPermuteInputsShuttle of(Mappings.TargetMapping mapping)
Creates a shuttle with an empty field list. It cannot handle GET calls but otherwise works OK.
-
fields
private static com.google.common.collect.ImmutableList<RelDataTypeField> fields(RelNode[] inputs)
-
visitInputRef
public RexNode visitInputRef(RexInputRef local)
- Specified by:
visitInputRef
in interfaceRexVisitor<RexNode>
- Overrides:
visitInputRef
in classRexShuttle
-
visitCall
public RexNode visitCall(RexCall call)
- Specified by:
visitCall
in interfaceRexVisitor<RexNode>
- Overrides:
visitCall
in classRexShuttle
-
lookup
private static int lookup(java.util.List<RelDataTypeField> fields, java.lang.String name)
-
-