From e532859c28ea930a542eb97e64ea88477ab8f7da Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 12 Oct 2023 07:45:07 +0000 Subject: [PATCH] update test to be default-compat --- .../druid/sql/calcite/CalciteWindowQueryTest.java | 2 +- .../calcite/tests/window/windowed_long_null.sqlTest | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java index e4c07d188e7b..b0172fcd0c8f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java @@ -127,6 +127,7 @@ public void verifyResults(QueryResults results) throws Exception } Assert.assertEquals(1, results.recordedQueries.size()); + maybeDumpActualResults(results.results); final WindowOperatorQuery query = getWindowOperatorQuery(results.recordedQueries); for (int i = 0; i < input.expectedOperators.size(); ++i) { final OperatorFactory expectedOperator = input.expectedOperators.get(i); @@ -145,7 +146,6 @@ public void verifyResults(QueryResults results) throws Exception Assert.assertEquals(types[i], results.signature.getColumnType(i).get()); } - maybeDumpActualResults(results.results); for (Object[] result : input.expectedResults) { for (int i = 0; i < result.length; i++) { // Jackson deserializes numbers as the minimum size required to diff --git a/sql/src/test/resources/calcite/tests/window/windowed_long_null.sqlTest b/sql/src/test/resources/calcite/tests/window/windowed_long_null.sqlTest index 8408573fe145..65d6265769a4 100644 --- a/sql/src/test/resources/calcite/tests/window/windowed_long_null.sqlTest +++ b/sql/src/test/resources/calcite/tests/window/windowed_long_null.sqlTest @@ -3,13 +3,18 @@ type: "operatorValidation" sql: | SELECT l2, - MIN(l2) OVER() + MIN(l2) OVER(partition by l2) FROM druid.numfoo - WHERE l2 is null or l2 = -1111 + WHERE l2 is null or l2 = -1111 or l2 = 0 expectedOperators: - - { type: "naivePartition", partitionColumns: [ ] } + - type: "naiveSort" + columns: + - column: "l2" + direction: "ASC" + - type: "naivePartition" + partitionColumns: [ "l2" ] - type: "window" processor: type: "framedAgg" @@ -22,3 +27,4 @@ expectedResults: - [null,null] - [null,null] - [null,null] + - [0,0] \ No newline at end of file