Package org.apache.calcite.rel.core
Class SetOp
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.core.SetOp
-
- All Implemented Interfaces:
java.lang.Cloneable
,RelOptNode
,RelNode
public abstract class SetOp extends AbstractRelNode
SetOp
is an abstract base for relational set operators such as UNION, MINUS (aka EXCEPT), and INTERSECT.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SetOp(RelOptCluster cluster, RelTraitSet traits, java.util.List<RelNode> inputs, SqlKind kind, boolean all)
Creates a SetOp.protected
SetOp(RelInput input)
Creates a SetOp by parsing serialized output.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SetOp
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.abstract SetOp
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs, boolean all)
protected RelDataType
deriveRowType()
RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.java.util.List<RelNode>
getInputs()
Returns an array of this relational expression's inputs.boolean
isHomogeneous(boolean compareNames)
Returns whether all the inputs of this set operator have the same row type as its output row.void
replaceInput(int ordinalInParent, RelNode p)
Replaces theordinalInParent
th input.-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, computeSelfCost, estimateRowCount, 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
-
SetOp
protected SetOp(RelOptCluster cluster, RelTraitSet traits, java.util.List<RelNode> inputs, SqlKind kind, boolean all)
Creates a SetOp.
-
SetOp
protected SetOp(RelInput input)
Creates a SetOp by parsing serialized output.
-
-
Method Detail
-
copy
public abstract SetOp copy(RelTraitSet traitSet, java.util.List<RelNode> inputs, boolean all)
-
copy
public SetOp 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
-
replaceInput
public void replaceInput(int ordinalInParent, RelNode p)
Description copied from interface:RelNode
Replaces theordinalInParent
th input. You must override this method if you overrideRelNode.getInputs()
.- Specified by:
replaceInput
in interfaceRelNode
- Overrides:
replaceInput
in classAbstractRelNode
- Parameters:
ordinalInParent
- Position of the child input, 0 is the firstp
- New node that should be put at positionordinalInParent
-
getInputs
public java.util.List<RelNode> getInputs()
Description copied from interface:RelNode
Returns an array of this relational expression's inputs. If there are no inputs, returns an empty list, notnull
.- Specified by:
getInputs
in interfaceRelNode
- Specified by:
getInputs
in interfaceRelOptNode
- Overrides:
getInputs
in classAbstractRelNode
- Returns:
- Array of this relational expression's inputs
-
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 classAbstractRelNode
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
deriveRowType
protected RelDataType deriveRowType()
- Overrides:
deriveRowType
in classAbstractRelNode
-
isHomogeneous
public boolean isHomogeneous(boolean compareNames)
Returns whether all the inputs of this set operator have the same row type as its output row.- Parameters:
compareNames
- Whether column names are important in the homogeneity comparison- Returns:
- Whether all the inputs of this set operator have the same row type as its output row
-
-