public class AggregateProjectPullUpConstantsRule extends RelOptRule
LogicalAggregate.
Effect of the rule
Since the transformed relational expression has to match the original relational expression, the constants are placed in a projection above the reduced aggregate. If those constants are not used, another rule will remove them from the project.
LogicalAggregate needs its group columns to be on the prefix of its input relational expression. Therefore, if a constant is not on the trailing edge of the group list, removing it will leave a hole. In this case, the rule adds a project before the aggregate to reorder the columns, and permutes them back afterwards.
| Modifier and Type | Field and Description |
|---|---|
static AggregateProjectPullUpConstantsRule |
INSTANCE
The singleton.
|
description, operands| Modifier and Type | Method and Description |
|---|---|
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match.
|
any, convert, convert, convertList, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unorderedpublic static final AggregateProjectPullUpConstantsRule INSTANCE
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>) to
register the expression.
onMatch in class RelOptRulecall - Rule callRelOptRule.matches(RelOptRuleCall)Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.