public class AggregateValuesRule extends RelOptRule
Values(currently just an empty
This is still useful because
Aggregate, which is in turn because
of empty relations need some special handling: a single row will be
generated, where each column's value depends on the specific aggregate calls
(e.g. COUNT is 0, SUM is NULL).
Sample query where this matters:
SELECT COUNT(*) FROM s.foo WHERE 1 = 0
This rule only applies to "grand totals", that is,
GROUP BY ().
GROUP BY clause will return one row per group key
value, and each group will consist of at least one row.
|Modifier and Type||Field and Description|
|Constructor and Description|
Creates an AggregateValuesRule.
|Modifier and Type||Method and Description|
Receives notification about a rule match.
any, convert, convert, convertList, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unordered
public static final AggregateValuesRule INSTANCE
public AggregateValuesRule(RelBuilderFactory relBuilderFactory)
relBuilderFactory- Builder for relational expressions
public void onMatch(RelOptRuleCall call)
call.relsholds the set of relational expressions which match the operands to the rule;
call.relsis 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.
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.