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
FieldsModifier and TypeFieldDescriptionfinal booleanprotected final com.google.common.collect.ImmutableList<RelHint>protected com.google.common.collect.ImmutableList<RelNode>final SqlKindFields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSetOp(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp.protectedSetOp(RelOptCluster cluster, RelTraitSet traits, List<RelNode> inputs, SqlKind kind, boolean all) Creates a SetOp.protectedCreates 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 SetOpcopy(RelTraitSet traitSet, List<RelNode> inputs, boolean all) protected RelDataTypeDescribes 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.booleanisHomogeneous(boolean compareNames) Returns whether all the inputs of this set operator have the same row type as its output row.voidreplaceInput(int ordinalInParent, RelNode p) Replaces theordinalInParentth 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHintsMethods 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:RelNodeCreates 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:
copyin interfaceRelNode- Overrides:
copyin classAbstractRelNode- Parameters:
traitSet- Trait setinputs- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
replaceInput
Description copied from interface:RelNodeReplaces theordinalInParentth input. You must override this method if you overrideRelNode.getInputs().- Specified by:
replaceInputin interfaceRelNode- Overrides:
replaceInputin 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:RelNodeReturns an array of this relational expression's inputs. If there are no inputs, returns an empty list, notnull.- Specified by:
getInputsin interfaceRelNode- Specified by:
getInputsin interfaceRelOptNode- Overrides:
getInputsin classAbstractRelNode- Returns:
- Array of this relational expression's inputs
-
explainTerms
Description copied from class:AbstractRelNodeDescribes 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:
explainTermsin classAbstractRelNode- Parameters:
pw- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
deriveRowType
- Overrides:
deriveRowTypein classAbstractRelNode
-
getHints
Description copied from interface:HintableReturns 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
-