siddharthteotia 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_r263125376
##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -4292,6 +4292,37 @@ private Sql checkSubQuery(String sql) {
checkPlanning(program, sql);
}
+ @Test public void testReduceAverageWithNoReduceSum() {
+ final AggregateReduceFunctionsRule.AggregateFunctionsToReduce
functionsToReduce =
+ new AggregateReduceFunctionsRule.AggregateFunctionsToReduce(
+ true, false, true,
+ true, true, true,
+ true, true, true,
+ true);
+ checkPlanning(
+ AggregateReduceFunctionsRule.getInstanceWithSpecificFunctionsToReduce(
+ functionsToReduce),
+ "select name, max(name), avg(deptno), min(name)"
+ + " from sales.dept group by name");
+ }
+
+ @Test public void testNoReduceSum() {
Review comment:
I have added more tests. Please let me know if the new tests are not added
the way you were thinking/suggesting.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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