kgyrtkirk commented on code in PR #15045:
URL: https://github.com/apache/druid/pull/15045#discussion_r1339793520


##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/SumSqlAggregator.java:
##########
@@ -35,11 +36,17 @@
 
 public class SumSqlAggregator extends SimpleSqlAggregator
 {
+  /**
+   * Workaround to avoid unconditional rewrite of SUM into COUNT+SUM0.

Review Comment:
   I might have been misleading: Druid is able to plan and execute the 
rewritten `COUNT` / `SUM0` things; but because `SUM0` is essentially a plain 
`SUM` there is no good reason to do that.
   
   note: there are no plan expectations in the drill testcases
   
   in the `CalciteWindowQueryTest`  cases the expectaion is to validate the top 
level Query ;
   
   I thinked its better to get back to plan the non-rewritten query as its more 
readable (as it doesn't have much benefit anyway)
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to