Class MultiJoin

java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.rules.MultiJoin
All Implemented Interfaces:
Cloneable, RelOptNode, RelNode

public final class MultiJoin extends AbstractRelNode
A MultiJoin represents a join of N inputs, whereas regular Joins represent strictly binary joins.
  • Field Details

    • joinFieldRefCountsMap

      public final com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> joinFieldRefCountsMap
  • Constructor Details

    • MultiJoin

      public MultiJoin(RelOptCluster cluster, List<RelNode> inputs, RexNode joinFilter, RelDataType rowType, boolean isFullOuterJoin, List<? extends @Nullable RexNode> outerJoinConditions, List<JoinRelType> joinTypes, List<? extends @Nullable ImmutableBitSet> projFields, com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> joinFieldRefCountsMap, @Nullable RexNode postJoinFilter)
      Constructs a MultiJoin.
      Parameters:
      cluster - cluster that join belongs to
      inputs - inputs into this multi-join
      joinFilter - join filter applicable to this join node
      rowType - row type of the join result of this node
      isFullOuterJoin - true if the join is a full outer join
      outerJoinConditions - outer join condition associated with each join input, if the input is null-generating in a left or right outer join; null otherwise
      joinTypes - the join type corresponding to each input; if an input is null-generating in a left or right outer join, the entry indicates the type of outer join; otherwise, the entry is set to INNER
      projFields - fields that will be projected from each input; if null, projection information is not available yet so it's assumed that all fields from the input are projected
      joinFieldRefCountsMap - counters of the number of times each field is referenced in join conditions, indexed by the input #
      postJoinFilter - filter to be applied after the joins are
  • Method Details

    • 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
    • copy

      public RelNode 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
    • 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

      public RelDataType deriveRowType()
      Overrides:
      deriveRowType in class AbstractRelNode
    • 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
    • accept

      public RelNode accept(RexShuttle shuttle)
      Description copied from interface: RelNode
      Accepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created. This new relation might have a different row-type.
      Specified by:
      accept in interface RelNode
      Overrides:
      accept in class AbstractRelNode
      Parameters:
      shuttle - Shuttle
      Returns:
      A copy of this node incorporating changes made by the shuttle to this node's children
    • getJoinFilter

      public RexNode getJoinFilter()
      Returns join filters associated with this MultiJoin.
    • isFullOuterJoin

      public boolean isFullOuterJoin()
      Returns true if the MultiJoin corresponds to a full outer join.
    • getOuterJoinConditions

      public List<@Nullable RexNode> getOuterJoinConditions()
      Returns outer join conditions for null-generating inputs.
    • getJoinTypes

      public List<JoinRelType> getJoinTypes()
      Returns join types of each input.
    • getProjFields

      public List<@Nullable ImmutableBitSet> getProjFields()
      Returns bitmaps representing the fields projected from each input; if an entry is null, all fields are projected.
    • getJoinFieldRefCountsMap

      public com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> getJoinFieldRefCountsMap()
      Returns the map of reference counts for each input, representing the fields accessed in join conditions.
    • getCopyJoinFieldRefCountsMap

      public Map<Integer,int[]> getCopyJoinFieldRefCountsMap()
      Returns a copy of the map of reference counts for each input, representing the fields accessed in join conditions.
    • getPostJoinFilter

      public @Nullable RexNode getPostJoinFilter()
      Returns post-join filter associated with this MultiJoin.