This is an automated email from the ASF dual-hosted git repository.
lakshsingla pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 6a42a24426 Fix a comment in the Calcite UT
testExactCountDistinctWithFilter (#14628)
6a42a24426 is described below
commit 6a42a24426e540e2fe4a46dbe857f98f68715591
Author: Adarsh Sanjeev <[email protected]>
AuthorDate: Wed Jul 26 12:02:26 2023 +0530
Fix a comment in the Calcite UT testExactCountDistinctWithFilter (#14628)
---
.../apache/druid/sql/calcite/CalciteQueryTest.java | 35 ++++++++++------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git
a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
index 0e920a5637..87db26ea5a 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
@@ -2334,26 +2334,23 @@ public class CalciteQueryTest extends
BaseCalciteQueryTest
{
notMsqCompatible();
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
+ // When useApproximateCountDistinct=false and
useGroupingSetForExactDistinct=false, planning fails due
// to a bug in the Calcite's rule (AggregateExpandDistinctAggregatesRule)
- try {
- testQuery(
- PLANNER_CONFIG_NO_HLL.withOverrides(
- ImmutableMap.of(
- PlannerConfig.CTX_KEY_USE_GROUPING_SET_FOR_EXACT_DISTINCT,
- "false"
- )
- ), // Enable exact count distinct
- sqlQuery,
- CalciteTests.REGULAR_USER_AUTH_RESULT,
- ImmutableList.of(),
- ImmutableList.of()
- );
- Assert.fail("query execution should fail");
- }
- catch (RuntimeException e) {
- Assert.assertTrue(e.getMessage().contains("Error while applying rule
AggregateExpandDistinctAggregatesRule"));
- }
+ Assert.assertThrows(
+ RuntimeException.class,
+ () -> testQuery(
+ PLANNER_CONFIG_NO_HLL.withOverrides(
+ ImmutableMap.of(
+ PlannerConfig.CTX_KEY_USE_GROUPING_SET_FOR_EXACT_DISTINCT,
"false",
+ PlannerConfig.CTX_KEY_USE_APPROXIMATE_COUNT_DISTINCT, false
+ )
+ ), // Enable exact count distinct
+ sqlQuery,
+ CalciteTests.REGULAR_USER_AUTH_RESULT,
+ ImmutableList.of(),
+ ImmutableList.of()
+ )
+ );
requireMergeBuffers(3);
testQuery(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]