Package org.apache.calcite.rel.core
Class RepeatUnion
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.BiRel
org.apache.calcite.rel.core.RepeatUnion
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
EnumerableRepeatUnion
,LogicalRepeatUnion
Relational expression that computes a repeat union (recursive union in SQL
terminology).
This operation is executed as follows:
- Evaluate the left input (i.e., seed relational expression) once. For UNION (but not UNION ALL), discard duplicated rows.
- Evaluate the right input (i.e., iterative relational expression) over and over until it produces no more results (or until an optional maximum number of iterations is reached). For UNION (but not UNION ALL), discard duplicated results.
NOTE: The current API is experimental and subject to change without notice.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
Whether duplicates are considered.final int
Maximum number of times to repeat the iterative relational expression; negative value means no limit, 0 means only seed will be evaluated.protected final @Nullable RelOptTable
Transient table where repeat union's intermediate results will be stored (optional).Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
RepeatUnion
(RelOptCluster cluster, RelTraitSet traitSet, RelNode seed, RelNode iterative, boolean all, int iterationLimit, @Nullable RelOptTable transientTable) -
Method Summary
Modifier and TypeMethodDescriptionprotected RelDataType
double
Returns an estimate of the number of rows this relational expression will return.Describes the inputs and attributes of this relational expression.@Nullable RelOptTable
Methods inherited from class org.apache.calcite.rel.BiRel
childrenAccept, getInputs, getLeft, getRight, replaceInput
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, 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
-
all
public final boolean allWhether duplicates are considered. -
iterationLimit
public final int iterationLimitMaximum number of times to repeat the iterative relational expression; negative value means no limit, 0 means only seed will be evaluated. -
transientTable
Transient table where repeat union's intermediate results will be stored (optional).
-
-
Constructor Details
-
RepeatUnion
protected RepeatUnion(RelOptCluster cluster, RelTraitSet traitSet, RelNode seed, RelNode iterative, boolean all, int iterationLimit, @Nullable RelOptTable transientTable)
-
-
Method Details
-
estimateRowCount
Description copied from interface:RelNode
Returns an estimate of the number of rows this relational expression will return.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about row count.- Specified by:
estimateRowCount
in interfaceRelNode
- Overrides:
estimateRowCount
in classAbstractRelNode
- Parameters:
mq
- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
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 classBiRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getSeedRel
-
getIterativeRel
-
getTransientTable
-
deriveRowType
- Overrides:
deriveRowType
in classAbstractRelNode
-