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
FieldsModifier and TypeFieldDescriptionfinal com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, traitSet -
Constructor Summary
ConstructorsConstructorDescriptionMultiJoin(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 RexNodeReturns 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.booleanReturns true if the MultiJoin corresponds to a full outer join.voidreplaceInput(int ordinalInParent, RelNode p) Replaces theordinalInParentth 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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: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
-
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
-
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
-
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
-
accept
Description copied from interface:RelNodeAccepts 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:
acceptin interfaceRelNode- Overrides:
acceptin 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.
-