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:
Cloneable
,RelOptNode
,Hintable
,RelNode
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
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
protected final com.google.common.collect.ImmutableList<RelHint>
protected com.google.common.collect.ImmutableList<RelNode>
final SqlKind
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
SetOp
(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp.protected
SetOp
(RelOptCluster cluster, RelTraitSet traits, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp.protected
Creates a SetOp by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptioncopy
(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract SetOp
copy
(RelTraitSet traitSet, List<RelNode> inputs, boolean all) protected RelDataType
Describes the inputs and attributes of this relational expression.com.google.common.collect.ImmutableList<RelHint>
getHints()
Returns the hints of this relational expressions as an immutable list.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, computeSelfCost, deepEquals, deepHashCode, equals, estimateRowCount, 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.hint.Hintable
attachHints, withHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
inputs
-
kind
-
all
public final boolean all -
hints
-
-
Constructor Details
-
SetOp
protected SetOp(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp. -
SetOp
protected SetOp(RelOptCluster cluster, RelTraitSet traits, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp. -
SetOp
Creates a SetOp by parsing serialized output.
-
-
Method Details
-
copy
-
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
-
replaceInput
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
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
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 classAbstractRelNode
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
deriveRowType
- Overrides:
deriveRowType
in classAbstractRelNode
-
getHints
Description copied from interface:Hintable
Returns the hints of this relational expressions as an immutable list. -
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
-