abhishekagarwal87 commented on code in PR #15045:
URL: https://github.com/apache/druid/pull/15045#discussion_r1339769976
##########
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:
```suggestion
* We use this custom aggregation function instead of builtin
SqlStdOperatorTable.SUM to avoid transformation to COUNT+SUM0. See CALCITE-6020
for more details. It can be handled differently after CALCITE-6020 is fixed.
```
##########
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:
btw following comments on CALCITE-6020, we would still have been able to
plan it but it won't be the plan that drill test case expects. But then drill
uses calcite too 🤔
##########
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:
btw following comments on CALCITE-6020, we would still have been able to
plan it but it won't be the plan that drill test case expects. But then drill
uses calcite too 🤔
--
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]