Class 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<RelNode> inputs
    • kind

      public final SqlKind kind
    • all

      public final boolean all
    • hints

      protected final<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
      copy in class AbstractRelNode
      traitSet - Trait set
      inputs - Inputs
      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
      replaceInput in class AbstractRelNode
      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
      getInputs in class AbstractRelNode
      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.
      explainTerms in class AbstractRelNode
      pw - Plan writer
      Plan writer for fluent-explain pattern
    • deriveRowType

      protected RelDataType deriveRowType()
      deriveRowType in class AbstractRelNode
    • getHints

      public<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.
      compareNames - Whether column names are important in the homogeneity comparison
      Whether all the inputs of this set operator have the same row type as its output row