Class SetOp

java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.core.SetOp
All Implemented Interfaces:
Cloneable, RelOptNode, Hintable, RelNode
Direct Known Subclasses:
Intersect, Minus, Union

public abstract class SetOp extends AbstractRelNode implements Hintable
SetOp is an abstract base for relational set operators such as UNION, MINUS (aka EXCEPT), and INTERSECT.
  • Field Details

    • inputs

      protected com.google.common.collect.ImmutableList<RelNode> inputs
    • kind

      public final SqlKind kind
    • all

      public final boolean all
    • hints

      protected final com.google.common.collect.ImmutableList<RelHint> hints
  • Constructor Details

  • Method Details

    • copy

      public abstract SetOp copy(RelTraitSet traitSet, List<RelNode> inputs, boolean all)
    • copy

      public SetOp copy(RelTraitSet traitSet, 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 interface RelNode
      Overrides:
      copy in class AbstractRelNode
      Parameters:
      traitSet - Trait set
      inputs - 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 the ordinalInParentth input. You must override this method if you override RelNode.getInputs().
      Specified by:
      replaceInput in interface RelNode
      Overrides:
      replaceInput in class AbstractRelNode
      Parameters:
      ordinalInParent - Position of the child input, 0 is the first
      p - New node that should be put at position ordinalInParent
    • getInputs

      public 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, not null.
      Specified by:
      getInputs in interface RelNode
      Specified by:
      getInputs in interface RelOptNode
      Overrides:
      getInputs in class AbstractRelNode
      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 call super.explainTerms, then call the RelWriter.input(String, RelNode) and RelWriter.item(String, Object) methods for each input and attribute.
      Overrides:
      explainTerms in class AbstractRelNode
      Parameters:
      pw - Plan writer
      Returns:
      Plan writer for fluent-explain pattern
    • deriveRowType

      protected RelDataType deriveRowType()
      Overrides:
      deriveRowType in class AbstractRelNode
    • getHints

      public com.google.common.collect.ImmutableList<RelHint> getHints()
      Description copied from interface: Hintable
      Returns the hints of this relational expressions as an immutable list.
      Specified by:
      getHints in interface Hintable
    • 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