public class MultiJoinProjectTransposeRule extends JoinProjectTransposeRule
LogicalProjects that are on top of a
MultiJoin and beneath a
LogicalJoin so the
LogicalProject appears above the
LogicalJoin.
In the process of doing
so, also save away information about the respective fields that are
referenced in the expressions in the
LogicalProject we're pulling up, as
well as the join condition, in the resultant MultiJoins
For example, if we have the following subselect:
(select X.x1, Y.y1 from X, Y
where X.x2 = Y.y2 and X.x3 = 1 and Y.y3 = 2)
The MultiJoin associated with (X, Y) associates x1 with X and
y1 with Y. Although x3 and y3 need to be read due to the filters, they are
not required after the row scan has completed and therefore are not saved.
The join fields, x2 and y2, are also tracked separately.
Note that by only pulling up projects that are on top of
MultiJoins, we preserve projections on top of row scans.
See the superclass for details on restrictions regarding which
LogicalProjects cannot be pulled.
| Modifier and Type | Field and Description |
|---|---|
static MultiJoinProjectTransposeRule |
MULTI_BOTH_PROJECT |
static MultiJoinProjectTransposeRule |
MULTI_LEFT_PROJECT |
static MultiJoinProjectTransposeRule |
MULTI_RIGHT_PROJECT |
BOTH_PROJECT, LEFT_PROJECT, RIGHT_PROJECTdescription, operands| Constructor and Description |
|---|
MultiJoinProjectTransposeRule(RelOptRuleOperand operand,
String description) |
| Modifier and Type | Method and Description |
|---|---|
protected RelNode |
getProjectChild(RelOptRuleCall call,
LogicalProject project,
boolean leftChild) |
protected LogicalProject |
getRightChild(RelOptRuleCall call) |
protected boolean |
hasLeftChild(RelOptRuleCall call) |
protected boolean |
hasRightChild(RelOptRuleCall call) |
getProjectChild, onMatchany, convert, convert, convertList, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unorderedpublic static final MultiJoinProjectTransposeRule MULTI_BOTH_PROJECT
public static final MultiJoinProjectTransposeRule MULTI_LEFT_PROJECT
public static final MultiJoinProjectTransposeRule MULTI_RIGHT_PROJECT
public MultiJoinProjectTransposeRule(RelOptRuleOperand operand, String description)
protected boolean hasLeftChild(RelOptRuleCall call)
hasLeftChild in class JoinProjectTransposeRulecall - RelOptRuleCallprotected boolean hasRightChild(RelOptRuleCall call)
hasRightChild in class JoinProjectTransposeRulecall - RelOptRuleCallprotected LogicalProject getRightChild(RelOptRuleCall call)
getRightChild in class JoinProjectTransposeRulecall - RelOptRuleCallprotected RelNode getProjectChild(RelOptRuleCall call, LogicalProject project, boolean leftChild)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.