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
public abstract class RepeatUnion extends BiRel
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
-
Field Summary
Fields Modifier and Type Field Description boolean
all
Whether duplicates are considered.int
iterationLimit
Maximum number of times to repeat the iterative relational expression; negative value means no limit, 0 means only seed will be evaluated. -
Constructor Summary
Constructors Modifier Constructor Description protected
RepeatUnion(RelOptCluster cluster, RelTraitSet traitSet, RelNode seed, RelNode iterative, boolean all, int iterationLimit)
-
Method Summary
Modifier and Type Method Description protected RelDataType
deriveRowType()
double
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will return.RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.RelNode
getIterativeRel()
RelNode
getSeedRel()
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
-
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.
-
-
Constructor Details
-
RepeatUnion
protected RepeatUnion(RelOptCluster cluster, RelTraitSet traitSet, RelNode seed, RelNode iterative, boolean all, int iterationLimit)
-
-
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)
andRelWriterImpl.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
-
deriveRowType
- Overrides:
deriveRowType
in classAbstractRelNode
-