| Constructor and Description |
|---|
LoptMultiJoin(MultiJoin multiJoin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRemovableOuterJoinFactor(int factIdx)
Adds a join factor to the set of factors that can be removed because the
factor is the null-generating factor in an outer join, its join keys are
unique, and the factor is not projected in the query.
|
void |
addRemovableSelfJoinPair(int factor1,
int factor2)
Adds to a map that keeps track of removable self-join pairs.
|
org.apache.calcite.rel.rules.LoptMultiJoin.Edge |
createEdge(RexNode condition) |
int |
findRef(int rexInputRef)
Determines the join factor corresponding to a RexInputRef.
|
void |
getChildFactors(LoptJoinTree joinTree,
ImmutableBitSet.Builder childFactors)
Deprecated.
|
ImmutableBitSet |
getFactorsRefByFactor(int factIdx)
Returns a bitmap corresponding to the factors referenced by the specified
factor in the various join filters that correspond to comparisons.
|
ImmutableBitSet |
getFactorsRefByJoinFilter(RexNode joinFilter)
Returns a bitmap corresponding to the factors referenced within
the specified join filter.
|
int[][] |
getFactorWeights()
Returns weights of the different factors relative to one another.
|
ImmutableBitSet |
getFieldsRefByJoinFilter(RexNode joinFilter)
Returns a bitmap corresponding to the fields referenced by a join filter.
|
RelNode |
getJoinFactor(int factIdx)
Returns the factor corresponding to the given factor index.
|
int[] |
getJoinFieldRefCounts(int factIdx)
Returns the join field reference counts for a factor.
|
List<RelDataTypeField> |
getJoinFields(LoptJoinTree left,
LoptJoinTree right)
Retrieves the fields corresponding to a join between a left and right
tree.
|
List<RexNode> |
getJoinFilters()
Returns all non-outer join filters in this multi-join.
|
@Nullable Integer |
getJoinRemovalFactor(int dimIdx)
Returns the factor id of the fact table corresponding to a dimension
table in a semi-join, in the case where the join with the dimension table
can be removed.
|
LogicalJoin |
getJoinRemovalSemiJoin(int dimIdx)
Returns the semi-join that allows the join of a dimension table to be
removed.
|
int |
getJoinStart(int factIdx)
Returns the starting offset within the multi-join for the specified factor.
|
List<RelDataTypeField> |
getMultiJoinFields()
Returns an array of fields contained within the multi-join.
|
MultiJoin |
getMultiJoinRel()
Returns the MultiJoin corresponding to this multi-join.
|
int |
getNumFieldsInJoinFactor(int factIdx)
Returns the number of fields in a given factor.
|
int |
getNumJoinFactors()
Returns the number of factors in this multi-join.
|
int |
getNumTotalFields()
Returns the total number of fields in the multi-join.
|
@Nullable Integer |
getOtherSelfJoinFactor(int factIdx)
Returns the other factor in a self-join pair if the factor passed in is
a factor in a removable self-join; otherwise, returns null.
|
@Nullable RexNode |
getOuterJoinCond(int factIdx)
Returns outer join conditions associated with the specified null-generating
factor.
|
ImmutableBitSet |
getOuterJoinFactors(int factIdx)
Returns a bitmap containing the factors that a null-generating factor is
dependent upon, if the factor is null-generating in a left or right outer
join; otherwise null is returned.
|
@Nullable ImmutableBitSet |
getProjFields(int factIdx)
Returns a bitmap containing the fields that are projected from a factor.
|
@Nullable Integer |
getRightColumnMapping(int rightFactor,
int rightOffset)
Determines whether there is a mapping from a column in the right factor
of a self-join to a column from the left factor.
|
boolean |
hasAllFactors(LoptJoinTree joinTree,
BitSet factorsNeeded)
Returns whether if a join tree contains all factors required.
|
boolean |
isLeftFactorInRemovableSelfJoin(int factIdx)
Returns whether the factor is the left factor in a self-join.
|
boolean |
isNullGenerating(int factIdx)
Returns whether the factor corresponds to a null-generating factor
in a left or right outer join.
|
boolean |
isRemovableOuterJoinFactor(int factIdx)
Return whether the factor corresponds to the null-generating factor in
an outer join that can be removed.
|
boolean |
isRightFactorInRemovableSelfJoin(int factIdx)
Returns whether the factor is the right factor in a self-join.
|
void |
setFactorWeights()
Sets weighting for each combination of factors, depending on which join
filters reference which factors.
|
void |
setJoinRemovalFactor(int dimIdx,
int factIdx)
Indicates that a dimension factor's join can be removed because of a
semijoin with a fact table.
|
void |
setJoinRemovalSemiJoin(int dimIdx,
LogicalJoin semiJoin)
Indicates the semi-join that allows the join of a dimension table to be
removed.
|
public LoptMultiJoin(MultiJoin multiJoin)
public MultiJoin getMultiJoinRel()
public int getNumJoinFactors()
public RelNode getJoinFactor(int factIdx)
factIdx - Factor to be returnedpublic int getNumTotalFields()
public int getNumFieldsInJoinFactor(int factIdx)
factIdx - Desired factorpublic List<RexNode> getJoinFilters()
public ImmutableBitSet getFactorsRefByJoinFilter(RexNode joinFilter)
joinFilter - Filter for which information will be returnedpublic List<RelDataTypeField> getMultiJoinFields()
public ImmutableBitSet getFieldsRefByJoinFilter(RexNode joinFilter)
joinFilter - the filter for which information will be returnedpublic int[][] getFactorWeights()
public ImmutableBitSet getFactorsRefByFactor(int factIdx)
factIdx - Factor for which information will be returnedpublic int getJoinStart(int factIdx)
factIdx - Factor for which information will be returnedpublic boolean isNullGenerating(int factIdx)
factIdx - Factor for which information will be returnedpublic ImmutableBitSet getOuterJoinFactors(int factIdx)
factIdx - Factor for which information will be returnedpublic @Nullable RexNode getOuterJoinCond(int factIdx)
factIdx - Factor for which information will be returnedpublic @Nullable ImmutableBitSet getProjFields(int factIdx)
factIdx - Factor for which information will be returnedpublic int[] getJoinFieldRefCounts(int factIdx)
factIdx - Factor for which information will be returnedpublic @Nullable Integer getJoinRemovalFactor(int dimIdx)
dimIdx - Dimension factor for which information will be returnedpublic LogicalJoin getJoinRemovalSemiJoin(int dimIdx)
dimIdx - Dimension factor for which information will be returnedpublic void setJoinRemovalFactor(int dimIdx,
int factIdx)
dimIdx - Dimension factorfactIdx - Fact factorpublic void setJoinRemovalSemiJoin(int dimIdx,
LogicalJoin semiJoin)
dimIdx - Dimension factorsemiJoin - the semijoin@RequiresNonNull(value={"joinStart","nFieldsInJoinFactor"})
public int findRef(@UnknownInitialization LoptMultiJoin this,
int rexInputRef)
rexInputRef - rexInputRef indexpublic void setFactorWeights()
public boolean hasAllFactors(LoptJoinTree joinTree, BitSet factorsNeeded)
joinTree - Join tree to be examinedfactorsNeeded - Bitmap of factors required@Deprecated public void getChildFactors(LoptJoinTree joinTree, ImmutableBitSet.Builder childFactors)
joinTree - join tree to be examinedchildFactors - bitmap to be setpublic List<RelDataTypeField> getJoinFields(LoptJoinTree left, LoptJoinTree right)
left - left hand side of the joinright - right hand side of the joinpublic void addRemovableOuterJoinFactor(int factIdx)
factIdx - Join factorpublic boolean isRemovableOuterJoinFactor(int factIdx)
factIdx - Factor in questionpublic void addRemovableSelfJoinPair(int factor1,
int factor2)
factor1 - one of the factors in the self-joinfactor2 - the second factor in the self-joinpublic @Nullable Integer getOtherSelfJoinFactor(int factIdx)
factIdx - one of the factors in a self-join pairpublic boolean isLeftFactorInRemovableSelfJoin(int factIdx)
factIdx - Factor in a self-joinpublic boolean isRightFactorInRemovableSelfJoin(int factIdx)
factIdx - Factor in a self-joinpublic @Nullable Integer getRightColumnMapping(int rightFactor, int rightOffset)
rightFactor - the index of the right factorrightOffset - the column offset of the right factorpublic org.apache.calcite.rel.rules.LoptMultiJoin.Edge createEdge(RexNode condition)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.