|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.sf.saffron.opt.VolcanoRule
|
+--net.sf.saffron.rel.SwapJoinRule
SwapJoinRule permutes the inputs to a join. Outer joins cannot
be permuted.
| Nested Class Summary | |
private static class |
SwapJoinRule.VariableReplacer
Walks over an expression, replacing references to fields of the left and right inputs. |
| Field Summary |
| Fields inherited from class net.sf.saffron.opt.VolcanoRule |
description, planner |
| Constructor Summary | |
SwapJoinRule()
|
|
| Method Summary | |
private static boolean |
contains(String[] names,
String name,
int count)
Whether names contains name in the first
count positions. |
private static String[] |
getFieldNames(SaffronType rowType)
|
private static void |
makeUnique(String[] names)
Ensures that every name in an array is distinct. |
void |
onMatch(VolcanoRuleCall call)
This method is called every time the rule matches. |
static ProjectRel |
swap(JoinRel join)
Returns a relational expression with the inputs switched round. |
| Methods inherited from class net.sf.saffron.opt.VolcanoRule |
convert, getOutConvention, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SwapJoinRule()
| Method Detail |
public static ProjectRel swap(JoinRel join)
join. Returns null if the join cannot be
swapped (for example, because it is an outer join).
private static String[] getFieldNames(SaffronType rowType)
public void onMatch(VolcanoRuleCall call)
VolcanoRulecall.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 VolcanoRuleCall.transformTo(net.sf.saffron.rel.SaffronRel)
to register the expression.
onMatch in class VolcanoRuleprivate static void makeUnique(String[] names)
private static boolean contains(String[] names,
String name,
int count)
names contains name in the first
count positions.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||