Package org.apache.calcite.rel.core
Class Collect
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Collect
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
EnumerableCollect
public class Collect extends SingleRel
A relational expression that collapses multiple rows into one.
Rules:
net.sf.farrago.fennel.rel.FarragoMultisetSplitterRule
creates a Collect from a call toSqlMultisetValueConstructor
or toSqlMultisetQueryConstructor
.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Collect(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, String fieldName)
Creates a Collect.Collect(RelInput input)
Creates a Collect by parsing serialized output. -
Method Summary
Modifier and Type Method Description RelNode
copy(RelTraitSet traitSet, List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.RelNode
copy(RelTraitSet traitSet, RelNode input)
static RelDataType
deriveCollectRowType(SingleRel rel, String fieldName)
Derives the output type of a collect relational expression.protected RelDataType
deriveRowType()
RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.String
getFieldName()
Returns the name of the sole output field.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
-
Field Details
-
Constructor Details
-
Method Details
-
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
-
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)
andRelWriterImpl.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classSingleRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getFieldName
Returns the name of the sole output field.- Returns:
- name of the sole output field
-
deriveRowType
- Overrides:
deriveRowType
in classSingleRel
-
deriveCollectRowType
Derives the output type of a collect relational expression.- Parameters:
rel
- relational expressionfieldName
- name of sole output field- Returns:
- output type of a collect relational expression
-