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:
java.lang.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
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Constructor Summary
Constructors Constructor Description Collect(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, java.lang.String fieldName)
Creates a Collect.Collect(RelInput input)
Creates a Collect by parsing serialized output.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RelNode
copy(RelTraitSet traitSet, java.util.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, java.lang.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.java.lang.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, computeDigest, computeSelfCost, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
-
-
-
Constructor Detail
-
Collect
public Collect(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, java.lang.String fieldName)
Creates a Collect.- Parameters:
cluster
- Clusterchild
- Child relational expressionfieldName
- Name of the sole output field
-
Collect
public Collect(RelInput input)
Creates a Collect by parsing serialized output.
-
-
Method Detail
-
copy
public final RelNode copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
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
public RelNode copy(RelTraitSet traitSet, RelNode input)
-
explainTerms
public RelWriter explainTerms(RelWriter pw)
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriterImpl.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
public java.lang.String getFieldName()
Returns the name of the sole output field.- Returns:
- name of the sole output field
-
deriveRowType
protected RelDataType deriveRowType()
- Overrides:
deriveRowType
in classSingleRel
-
deriveCollectRowType
public static RelDataType deriveCollectRowType(SingleRel rel, java.lang.String fieldName)
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
-
-