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) |
ImmutableBitSet |
getFactorsRefByJoinFilter(RexNode joinFilter) |
int[][] |
getFactorWeights() |
ImmutableBitSet |
getFieldsRefByJoinFilter(RexNode joinFilter) |
RelNode |
getJoinFactor(int factIdx) |
int[] |
getJoinFieldRefCounts(int factIdx) |
List<RelDataTypeField> |
getJoinFields(LoptJoinTree left,
LoptJoinTree right)
Retrieves the fields corresponding to a join between a left and right
tree
|
List<RexNode> |
getJoinFilters() |
Integer |
getJoinRemovalFactor(int dimIdx) |
SemiJoin |
getJoinRemovalSemiJoin(int dimIdx) |
int |
getJoinStart(int factIdx) |
List<RelDataTypeField> |
getMultiJoinFields()
Returns array of fields contained within the multi-join
|
MultiJoin |
getMultiJoinRel() |
int |
getNumFieldsInJoinFactor(int factIdx) |
int |
getNumJoinFactors() |
int |
getNumTotalFields() |
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.
|
RexNode |
getOuterJoinCond(int factIdx) |
ImmutableBitSet |
getOuterJoinFactors(int factIdx) |
ImmutableBitSet |
getProjFields(int factIdx) |
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 true if a join tree contains all factors required
|
boolean |
isLeftFactorInRemovableSelfJoin(int factIdx) |
boolean |
isNullGenerating(int factIdx) |
boolean |
isRemovableOuterJoinFactor(int factIdx) |
boolean |
isRightFactorInRemovableSelfJoin(int factIdx) |
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,
SemiJoin semiJoin)
Indicates the semijoin 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 RexNode getOuterJoinCond(int factIdx)
factIdx
- factor for which information will be returnedpublic ImmutableBitSet getProjFields(int factIdx)
factIdx
- factor for which information will be returnedpublic int[] getJoinFieldRefCounts(int factIdx)
factIdx
- factor for which information will be returnedpublic Integer getJoinRemovalFactor(int dimIdx)
dimIdx
- the dimension factor for which information will be returnedpublic SemiJoin getJoinRemovalSemiJoin(int dimIdx)
dimIdx
- the dimension factor for which information will be returnedpublic void setJoinRemovalFactor(int dimIdx, int factIdx)
dimIdx
- id of the dimension factorfactIdx
- id of the fact factorpublic void setJoinRemovalSemiJoin(int dimIdx, SemiJoin semiJoin)
dimIdx
- id of the dimension factorsemiJoin
- the semijoinpublic int findRef(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 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 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–2018 The Apache Software Foundation. All rights reserved.