Class Uncollect
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
EnumerableUncollect
The input may have multiple columns, but each must be a multiset or
array. If withOrdinality
, the output contains an extra
ORDINALITY
column.
Like its inverse operation Collect
, Uncollect is generally
invoked in a nested loop, driven by
LogicalCorrelate
or similar.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ConstructorDescriptionUncollect
(RelOptCluster cluster, RelTraitSet traitSet, RelNode child) Deprecated.Uncollect
(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean withOrdinality, List<String> itemAliases) Creates an Uncollect.Creates an Uncollect by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionfinal RelNode
copy
(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.copy
(RelTraitSet traitSet, RelNode input) static Uncollect
create
(RelTraitSet traitSet, RelNode input, boolean withOrdinality, List<String> itemAliases) Creates an Uncollect.protected RelDataType
static RelDataType
deriveUncollectRowType
(RelNode rel, boolean withOrdinality, List<String> itemAliases) Returns the row type returned by applying the 'UNNEST' operation to a relational expression.Describes the inputs and attributes of this relational expression.Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, estimateRowCount, getInput, getInputs, replaceInput
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, computeSelfCost, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
withOrdinality
public final boolean withOrdinality
-
-
Constructor Details
-
Uncollect
Deprecated. -
Uncollect
public Uncollect(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean withOrdinality, List<String> itemAliases) Creates an Uncollect.Use
create(org.apache.calcite.plan.RelTraitSet, org.apache.calcite.rel.RelNode, boolean, java.util.List<java.lang.String>)
unless you know what you're doing. -
Uncollect
Creates an Uncollect by parsing serialized output.
-
-
Method Details
-
create
public static Uncollect create(RelTraitSet traitSet, RelNode input, boolean withOrdinality, List<String> itemAliases) Creates an Uncollect.Each field of the input relational expression must be an array or multiset.
- Parameters:
traitSet
- Trait setinput
- Input relational expressionwithOrdinality
- Whether output should contain an ORDINALITY columnitemAliases
- Aliases for the operand items
-
explainTerms
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriter.input(String, RelNode)
andRelWriter.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classSingleRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
copy
Description copied from interface:RelNode
Creates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copy
in interfaceRelNode
- Overrides:
copy
in classAbstractRelNode
- Parameters:
traitSet
- Trait setinputs
- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
copy
-
deriveRowType
- Overrides:
deriveRowType
in classSingleRel
-
deriveUncollectRowType
public static RelDataType deriveUncollectRowType(RelNode rel, boolean withOrdinality, List<String> itemAliases) Returns the row type returned by applying the 'UNNEST' operation to a relational expression.Each column in the relational expression must be a multiset of structs or an array. The return type is the combination of expanding element types from each column, plus an ORDINALITY column if
withOrdinality
. IfitemAliases
is not empty, the element types would not expand, each column element outputs as a whole (the return type has same column types as input type).
-