org.eigenbase.rel.rules
Class SwapJoinRule
java.lang.Object
org.eigenbase.relopt.RelOptRule
org.eigenbase.rel.rules.SwapJoinRule
public class SwapJoinRule
- extends RelOptRule
SwapJoinRule
permutes the inputs to a join. Outer joins cannot
be permuted.
- Since:
- Nov 26, 2003
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/rel/rules/SwapJoinRule.java#3 $
- Author:
- jhyde
Nested Class Summary |
private static class |
SwapJoinRule.VariableReplacer
Walks over an expression, replacing references to fields of the left and
right inputs. |
Constructor Summary |
private |
SwapJoinRule()
Creates a SwapJoinRule. |
Methods inherited from class org.eigenbase.relopt.RelOptRule |
convert, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, mergeTraitsAndConvert, mergeTraitsAndConvert, toString |
instance
public static final SwapJoinRule instance
- The singleton
SwapJoinRule
private SwapJoinRule()
- Creates a SwapJoinRule.
swap
public static RelNode swap(JoinRel join)
- Returns a relational expression with the inputs switched round. Does not
modify
join
. Returns null if the join cannot be swapped (for
example, because it is an outer join).
swap
public static RelNode swap(JoinRel join,
boolean swapOuterJoins)
- Parameters:
join
- join to be swappedswapOuterJoins
- whether outer joins should be swapped
- Returns:
- swapped join if swapping possible; else null
onMatch
public void onMatch(RelOptRuleCall call)
- Description copied from class:
RelOptRule
- Receives notification about a rule match. At the time that this method is
called,
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.
- Specified by:
onMatch
in class RelOptRule
- Parameters:
call
- Rule call- See Also:
RelOptRule.matches(RelOptRuleCall)