@Value.Enclosing public class JoinProjectTransposeRule extends RelRule<JoinProjectTransposeRule.Config> implements TransformationRule
Join one of whose inputs is a
LogicalProject, and
pulls the project up.
Projections are pulled up if the
LogicalProject doesn't originate from
a null generating input in an outer join.
| Modifier and Type | Class and Description |
|---|---|
static interface |
JoinProjectTransposeRule.Config
Rule configuration.
|
RelRule.Done, RelRule.MatchHandler<R extends RelOptRule>, RelRule.OperandBuilder, RelRule.OperandDetailBuilder<R extends RelNode>, RelRule.OperandTransformRelOptRule.ConverterRelOptRuleOperanddescription, operands, relBuilderFactory| Modifier | Constructor and Description |
|---|---|
protected |
JoinProjectTransposeRule(JoinProjectTransposeRule.Config config)
Creates a JoinProjectTransposeRule.
|
|
JoinProjectTransposeRule(RelOptRuleOperand operand,
String description)
Deprecated.
|
|
JoinProjectTransposeRule(RelOptRuleOperand operand,
String description,
boolean includeOuter,
RelBuilderFactory relBuilderFactory)
Deprecated.
|
|
JoinProjectTransposeRule(RelOptRuleOperand operand,
String description,
boolean includeOuter,
RelFactories.ProjectFactory projectFactory)
Deprecated.
|
|
JoinProjectTransposeRule(RelOptRuleOperand operand,
String description,
RelFactories.ProjectFactory projectFactory)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createProjectExprs(@Nullable Project project,
RelNode joinChild,
int adjustmentAmount,
RexBuilder rexBuilder,
List<RelDataTypeField> joinChildrenFields,
List<Pair<RexNode,String>> projects)
Creates projection expressions corresponding to one of the inputs into
the join.
|
protected 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.
|
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match.
|
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unorderedprotected JoinProjectTransposeRule(JoinProjectTransposeRule.Config config)
@Deprecated public JoinProjectTransposeRule(RelOptRuleOperand operand, String description, boolean includeOuter, RelBuilderFactory relBuilderFactory)
@Deprecated public JoinProjectTransposeRule(RelOptRuleOperand operand, String description)
@Deprecated public JoinProjectTransposeRule(RelOptRuleOperand operand, String description, RelFactories.ProjectFactory projectFactory)
@Deprecated public JoinProjectTransposeRule(RelOptRuleOperand operand, String description, boolean includeOuter, RelFactories.ProjectFactory projectFactory)
public void onMatch(RelOptRuleCall call)
RelOptRulecall.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.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelHintsPropagator) to
register the expression.
onMatch in class RelOptRulecall - Rule callRelOptRule.matches(RelOptRuleCall)protected boolean hasLeftChild(RelOptRuleCall call)
protected boolean hasRightChild(RelOptRuleCall call)
protected Project getRightChild(RelOptRuleCall call)
protected RelNode getProjectChild(RelOptRuleCall call, Project project, boolean leftChild)
call - RelOptRuleCallproject - project RelNodeleftChild - true if the project corresponds to the left projectionprotected void createProjectExprs(@Nullable Project project, RelNode joinChild, int adjustmentAmount, RexBuilder rexBuilder, List<RelDataTypeField> joinChildrenFields, List<Pair<RexNode,String>> projects)
project - the projection input into the join (if it exists)joinChild - the child of the projection input (if there is a
projection); otherwise, this is the join inputadjustmentAmount - the amount the expressions need to be shifted byrexBuilder - rex builderjoinChildrenFields - concatenation of the fields from the left and
right join inputs (once the projections have been
removed)projects - Projection expressions & names to be createdCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.