Package org.apache.calcite.sql2rel
Class RelFieldTrimmer.TrimResult
- All Implemented Interfaces:
Serializable
,Comparable<Pair<RelNode,
,Mapping>> Map.Entry<RelNode,
Mapping>
- Enclosing class:
RelFieldTrimmer
Result of an attempt to trim columns from a relational expression.
The mapping describes where to find the columns wanted by the parent of the current relational expression.
The mapping is a
Mappings.SourceMapping
, which means
that no column can be used more than once, and some columns are not used.
columnsUsed.getSource(i)
returns the source of the i'th output
field.
For example, consider the mapping for a relational expression that has 4 output columns but only two are being used. The mapping {2 → 1, 3 → 0} would give the following behavior:
- columnsUsed.getSourceCount() returns 4
- columnsUsed.getTargetCount() returns 2
- columnsUsed.getSource(0) returns 3
- columnsUsed.getSource(1) returns 2
- columnsUsed.getSource(2) throws IndexOutOfBounds
- columnsUsed.getTargetOpt(3) returns 0
- columnsUsed.getTargetOpt(0) returns -1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.util.Pair
Pair.PairWithOrdinalConsumer<K,
V> -
Field Summary
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
TrimResult
Creates a TrimResult.- Parameters:
left
- New relational expressionright
- Mapping of fields onto original fields
-