|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.RelOptRule com.lucidera.opt.LoptRemoveSelfJoinRule
public class LoptRemoveSelfJoinRule
LoptRemoveSelfJoinRule implements a rule that converts removable self-joins into a scan on the common underlying row scan table. The projection and filtering applied on each join input are combined into one.
This rule only needs to look for a very specific RelNode pattern because
it assumes that LoptModifyRemovableSelfJoinRule
has already been
applied.
Field Summary | |
---|---|
static LoptRemoveSelfJoinRule |
instance
|
Fields inherited from class org.eigenbase.relopt.RelOptRule |
---|
ANY, description, operands |
Constructor Summary | |
---|---|
private |
LoptRemoveSelfJoinRule()
Creates a LoptRemoveSelfJoinRule. |
Method Summary | |
---|---|
private RelNode |
combineFilters(FilterRel leftFilter,
FilterRel rightFilter,
LcsRowScanRel newRowScan)
Combines filters on top of row scans into a single filter. |
private ProjectRel |
combineProjects(ProjectRel leftProject,
ProjectRel rightProject,
RelNode projInput)
Combines projections on top of filters that are top of row scans into a single projection. |
private LcsRowScanRel |
combineRowScans(LcsRowScanRel leftRowScan,
LcsRowScanRel rightRowScan)
Combines two row scans into one by taking the intersection of the inputs into each row scan. |
private RelNode |
createJoinReplacement(JoinRel joinRel,
ProjectRel joinInput)
Replaces the join with whatever additional filters need to be applied as a result of removing the join. |
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match. |
Methods inherited from class org.eigenbase.relopt.RelOptRule |
---|
convert, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, mergeTraitsAndConvert, mergeTraitsAndConvert, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final LoptRemoveSelfJoinRule instance
Constructor Detail |
---|
private LoptRemoveSelfJoinRule()
Method Detail |
---|
public void onMatch(RelOptRuleCall call)
RelOptRule
call.rels
holds the set of relational
expressions which match the operands to the rule;
call.rels[0]
is the root expression.
Typically a rule would check that the nodes are valid matches, creates
a new expression, then calls back RelOptRuleCall.transformTo(org.eigenbase.rel.RelNode)
to
register the expression.
onMatch
in class RelOptRule
call
- Rule callRelOptRule.matches(RelOptRuleCall)
private LcsRowScanRel combineRowScans(LcsRowScanRel leftRowScan, LcsRowScanRel rightRowScan)
leftRowScan
- left row scanrightRowScan
- right row scan
private RelNode combineFilters(FilterRel leftFilter, FilterRel rightFilter, LcsRowScanRel newRowScan)
leftFilter
- filter on top of the original left row scanrightFilter
- filter on top of the original right row scannewRowScan
- the new, combined row scan
private ProjectRel combineProjects(ProjectRel leftProject, ProjectRel rightProject, RelNode projInput)
leftProject
- the left projectionrightProject
- the right projectionprojInput
- the input into the combined projection
private RelNode createJoinReplacement(JoinRel joinRel, ProjectRel joinInput)
joinRel
- the original joinjoinInput
- the new input into the join
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |