|
|||||||||
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.lcs.LcsIndexSemiJoinRule
public class LcsIndexSemiJoinRule
LcsIndexSemiJoinRule implements the rule for converting a semijoin expression into the actual operations used to execute the semijoin. Specfically,
SemiJoinRel(LcsRowScanRel, D) -> LcsRowScanRel( LcsIndexMergeRel( LcsIndexSearchRel( LcsFennelSortRel( AggregateRel( ProjectRel(D))))))
Note that this rule assumes that no projections have been pushed into the LcsRowScanRels.
Field Summary |
---|
Fields inherited from class org.eigenbase.relopt.RelOptRule |
---|
ANY, description, operands |
Constructor Summary | |
---|---|
LcsIndexSemiJoinRule(RelOptRuleOperand operand,
String id)
Creates an LcsIndexSemiJoinRule. |
Method Summary | |
---|---|
private static RelNode[] |
addNewIndexAccessRel(RelOptRuleCall call,
int rowScanRelPosInCall,
FennelSortRel sort,
FemLocalIndex index,
Double indexSelectivity)
|
private RexNode[] |
castJoinKeys(List<Integer> leftKeys,
RelDataTypeField[] leftFields,
int nKeys,
List<Integer> keyOrder,
RexBuilder rexBuilder,
RexNode[] rhsExps,
FarragoTypeFactory typeFactory)
Casts the types of the join keys from the right hand side of the join to the types of the left hand side |
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match. |
private void |
transformSemiJoin(SemiJoinRel semiJoin,
LcsRowScanRel origRowScan,
FemLocalIndex index,
List<Integer> keyOrder,
RelNode rightRel,
RelOptRuleCall call)
Converts the semijoin expression once a valid index has been found |
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 |
Constructor Detail |
---|
public LcsIndexSemiJoinRule(RelOptRuleOperand operand, String id)
operand
- Root operand, must not be nullid
- Description of ruleMethod 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 void transformSemiJoin(SemiJoinRel semiJoin, LcsRowScanRel origRowScan, FemLocalIndex index, List<Integer> keyOrder, RelNode rightRel, RelOptRuleCall call)
semiJoin
- the semijoin expression to be convertedorigRowScan
- original row scan on the left hand side of the
semijoinindex
- index to be used to scan the left hand side of the semijoinkeyOrder
- positions of the keys that match the index, in the order
of matchrightRel
- right hand side of the semijoincall
- rule callprivate RexNode[] castJoinKeys(List<Integer> leftKeys, RelDataTypeField[] leftFields, int nKeys, List<Integer> keyOrder, RexBuilder rexBuilder, RexNode[] rhsExps, FarragoTypeFactory typeFactory)
leftKeys
- left hand side join keysleftFields
- fields corresponding to the left hand side of the joinnKeys
- number of keys to be castkeyOrder
- positions of the keys that match the index, in the order
of matchrexBuilder
- rex builder from right hand side of joinrhsExps
- right hand side expressions that need to be casttypeFactory
- type factory
private static RelNode[] addNewIndexAccessRel(RelOptRuleCall call, int rowScanRelPosInCall, FennelSortRel sort, FemLocalIndex index, Double indexSelectivity)
call
- call this rule is matched againstrowScanRelPosInCall
- the position(start from 0) of the
LcsRowScanRel in the sequence of rels matched by this rulesort
- input to the index search rel to be createdindex
- the index to use in the index search relindexSelectivity
- selectivity of the index being added
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |