Package org.apache.calcite.rel.rules
Class MultiJoin
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.rules.MultiJoin
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
A MultiJoin represents a join of N inputs, whereas regular Joins
represent strictly binary joins.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Modifier and TypeFieldDescriptionfinal com.google.common.collect.ImmutableMap<Integer,
ImmutableIntList> Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, traitSet
-
Constructor Summary
ConstructorDescriptionMultiJoin
(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. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(RexShuttle shuttle) Accepts a visit from a shuttle.copy
(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.Describes the inputs and attributes of this relational expression.Returns a copy of the map of reference counts for each input, representing the fields accessed in join conditions.Returns an array of this relational expression's inputs.com.google.common.collect.ImmutableMap<Integer,
ImmutableIntList> Returns the map of reference counts for each input, representing the fields accessed in join conditions.Returns join filters associated with this MultiJoin.Returns join types of each input.Returns outer join conditions for null-generating inputs.@Nullable RexNode
Returns post-join filter associated with this MultiJoin.List<@Nullable ImmutableBitSet>
Returns bitmaps representing the fields projected from each input; if an entry is null, all fields are projected.boolean
Returns true if the MultiJoin corresponds to a full outer join.void
replaceInput
(int ordinalInParent, RelNode p) Replaces theordinalInParent
th input.Methods inherited from class org.apache.calcite.rel.AbstractRelNode
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.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
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 toinputs
- inputs into this multi-joinjoinFilter
- join filter applicable to this join noderowType
- row type of the join result of this nodeisFullOuterJoin
- true if the join is a full outer joinouterJoinConditions
- outer join condition associated with each join input, if the input is null-generating in a left or right outer join; null otherwisejoinTypes
- 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 INNERprojFields
- 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 projectedjoinFieldRefCountsMap
- 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
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
-
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
-
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
-
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
-
accept
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 interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
getJoinFilter
Returns join filters associated with this MultiJoin. -
isFullOuterJoin
public boolean isFullOuterJoin()Returns true if the MultiJoin corresponds to a full outer join. -
getOuterJoinConditions
Returns outer join conditions for null-generating inputs. -
getJoinTypes
Returns join types of each input. -
getProjFields
Returns bitmaps representing the fields projected from each input; if an entry is null, all fields are projected. -
getJoinFieldRefCountsMap
Returns the map of reference counts for each input, representing the fields accessed in join conditions. -
getCopyJoinFieldRefCountsMap
Returns a copy of the map of reference counts for each input, representing the fields accessed in join conditions. -
getPostJoinFilter
Returns post-join filter associated with this MultiJoin.
-