kfaraz commented on a change in pull request #12182:
URL: https://github.com/apache/druid/pull/12182#discussion_r789379331
##########
File path: sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
##########
@@ -2143,6 +2143,93 @@ public void testHavingOnExactCountDistinct() throws
Exception
);
}
+ @Test
+ public void testExactCountDistinctWithFilter() throws Exception
+ {
+
+ final String sqlQuery = "SELECT COUNT(DISTINCT foo.dim1) FILTER(WHERE
foo.cnt = 1), SUM(foo.cnt) FROM druid.foo";
+ // When useApproximateCountDistinct=true and
useGroupingSetForExactDistinct=false, planning fails due
+ // to a bug in the Calcite's rule (AggregateExpandDistinctAggregatesRule)
+ try {
+ testQuery(
+ PLANNER_CONFIG_NO_HLL, // Enable exact count distinct
Review comment:
Even though it is the default behaviour, I think it would be better to
use `withOverrides` here too for symmetry with the positive test case or if the
default changes later.
--
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]