|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.RelOptRule net.sf.farrago.fennel.rel.FennelReshapeRule
public class FennelReshapeRule
FennelReshapeRule is a rule that converts a CalcRel
into a FennelReshapeRel
, provided the CalcRel
only references simple
projections and contains a simple condition, if it has a condition.
The projection is simple if it consists of only RexInputRef
s or
CASTs of RexInputRef
s where the cast effectively does not require any
actual data conversion or data validation.
The condition is simple if the expression is an AND of filters, where each
filter is of the form RexInputRef
OP RexLiteral
. Each RexInputRef
can only be referenced once, and OP is either =, >, >=, <,
or <=. However, the non-equality operators can only be referenced once.
Field Summary | |
---|---|
static FennelReshapeRule |
instance
|
Fields inherited from class org.eigenbase.relopt.RelOptRule |
---|
ANY, description, operands |
Constructor Summary | |
---|---|
private |
FennelReshapeRule()
Creates a FennelReshapeRule. |
Method Summary | |
---|---|
CallingConvention |
getOutConvention()
Returns the calling convention of the result of firing this rule, null if not known. |
private boolean |
isCastSimple(RelDataType origType,
RelDataType castType)
Returns true if a type is a simple cast of another type. |
private boolean |
isConditionSimple(CalcRel calcRel,
RexNode filterExprs,
List<Integer> filterList,
List<RexLiteral> literals,
List<CompOperatorEnum> op)
Determines if a filter condition is a simple one and returns the parameters corresponding to the simple filters. |
private RelDataType |
isProjectSimple(CalcRel calcRel,
List<Integer> projOrdinals)
Determines if a projection is simple. |
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match. |
Methods inherited from class org.eigenbase.relopt.RelOptRule |
---|
convert, equals, equals, getOperand, getOperands, 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 FennelReshapeRule instance
Constructor Detail |
---|
private FennelReshapeRule()
Method Detail |
---|
public CallingConvention getOutConvention()
RelOptRule
getOutConvention
in class RelOptRule
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 RelDataType isProjectSimple(CalcRel calcRel, List<Integer> projOrdinals)
calcRel
- CalcRel containing the projectionprojOrdinals
- if the projection is simple, returns the ordinals of
the projection inputs
private boolean isCastSimple(RelDataType origType, RelDataType castType)
origType
- original type passed into the cast operandcastType
- type the operand will be casted to
private boolean isConditionSimple(CalcRel calcRel, RexNode filterExprs, List<Integer> filterList, List<RexLiteral> literals, List<CompOperatorEnum> op)
calcRel
- original CalcRelfilterExprs
- filter expression being analyzedfilterList
- returns the list of filter ordinals in the simple
expressionliterals
- returns the list of literals to be used in the simple
comparisonsop
- returns the operator to be used in the simple comparison
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |