zabetak commented on a change in pull request #1033: [CALCITE-2820] Add a
version of AggregateReduceFunctionsRule that does not reduce SUM to SUM0
URL: https://github.com/apache/calcite/pull/1033#discussion_r261553959
##########
File path:
core/src/main/java/org/apache/calcite/rel/rules/AggregateReduceFunctionsRule.java
##########
@@ -94,15 +94,23 @@
/** The singleton. */
public static final AggregateReduceFunctionsRule INSTANCE =
- new AggregateReduceFunctionsRule(operand(LogicalAggregate.class, any()),
+ new AggregateReduceFunctionsRule(operand(LogicalAggregate.class, any()),
true,
RelFactories.LOGICAL_BUILDER);
+ /** The singleton. */
+ public static final AggregateReduceFunctionsRule NO_REDUCE_SUM =
+ new AggregateReduceFunctionsRule(operand(LogicalAggregate.class,
any()), false,
+ RelFactories.LOGICAL_BUILDER);
+
+ private final boolean reduceSum;
+
//~ Constructors -----------------------------------------------------------
/** Creates an AggregateReduceFunctionsRule. */
- public AggregateReduceFunctionsRule(RelOptRuleOperand operand,
+ public AggregateReduceFunctionsRule(RelOptRuleOperand operand, boolean
reduceSum,
Review comment:
Moreover, I don't like a lot the idea of making the rule configurable
**just** for a single function (i.e., SUM). If we go this direction, I would
prefer to be able to configure the behavior of this rule for all functions that
it handles.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services