Class MultiJoinProjectTransposeRule
- All Implemented Interfaces:
TransformationRule
LogicalProject
s 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 MultiJoin
s
For example, if we have the following sub-query:
(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
MultiJoin
s, we preserve projections on top of row scans.
See the superclass for details on restrictions regarding which
LogicalProject
s cannot be pulled.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Rule configuration.Nested classes/interfaces inherited from class org.apache.calcite.plan.RelRule
RelRule.Done, RelRule.MatchHandler<R extends RelOptRule>, RelRule.OperandBuilder, RelRule.OperandDetailBuilder<R extends RelNode>, RelRule.OperandTransform
Nested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule
RelOptRule.ConverterRelOptRuleOperand
-
Field Summary
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
Constructor Summary
ModifierConstructorDescriptionMultiJoinProjectTransposeRule
(RelOptRuleOperand operand, String description) Deprecated.MultiJoinProjectTransposeRule
(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, String description) Deprecated.protected
Creates a MultiJoinProjectTransposeRule. -
Method Summary
Modifier and TypeMethodDescriptionprotected RelNode
getProjectChild
(RelOptRuleCall call, Project project, boolean leftChild) Returns the child of the project that will be used as input into the new LogicalJoin once the projects are pulled above the LogicalJoin.protected Project
getRightChild
(RelOptRuleCall call) Returns the Project corresponding to the right child.protected boolean
hasLeftChild
(RelOptRuleCall call) Returns whether the rule was invoked with a left project child.protected boolean
hasRightChild
(RelOptRuleCall call) Returns whether the rule was invoked with 2 children.Methods inherited from class org.apache.calcite.rel.rules.JoinProjectTransposeRule
createProjectExprs, onMatch
Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
Constructor Details
-
MultiJoinProjectTransposeRule
Creates a MultiJoinProjectTransposeRule. -
MultiJoinProjectTransposeRule
Deprecated. -
MultiJoinProjectTransposeRule
@Deprecated public MultiJoinProjectTransposeRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, String description) Deprecated.
-
-
Method Details
-
hasLeftChild
Description copied from class:JoinProjectTransposeRule
Returns whether the rule was invoked with a left project child.- Overrides:
hasLeftChild
in classJoinProjectTransposeRule
-
hasRightChild
Description copied from class:JoinProjectTransposeRule
Returns whether the rule was invoked with 2 children.- Overrides:
hasRightChild
in classJoinProjectTransposeRule
-
getRightChild
Description copied from class:JoinProjectTransposeRule
Returns the Project corresponding to the right child.- Overrides:
getRightChild
in classJoinProjectTransposeRule
-
getProjectChild
Description copied from class:JoinProjectTransposeRule
Returns the child of the project that will be used as input into the new LogicalJoin once the projects are pulled above the LogicalJoin.- Overrides:
getProjectChild
in classJoinProjectTransposeRule
- Parameters:
call
- RelOptRuleCallproject
- project RelNodeleftChild
- true if the project corresponds to the left projection- Returns:
- child of the project that will be used as input into the new LogicalJoin once the projects are pulled above the LogicalJoin
-