diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index fcaaf044824..676bf8b4dd4 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -1217,11 +1217,6 @@ public class BaseCalciteQueryTest extends CalciteTestBase skipVectorize = true; } - protected void sqlNativeIncompatible() - { - assumeTrue(testBuilder().config.isRunningMSQ(), "test case is not SQL native compatible"); - } - protected void msqIncompatible() { assumeFalse(testBuilder().config.isRunningMSQ(), "test case is not MSQ compatible"); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java index 0cc30c49c34..01bab3f99de 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java @@ -7731,13 +7731,10 @@ public class DrillWindowQueryTest extends BaseCalciteQueryTest windowQueryTest(); } - // This test gives the following error on sql-native engine: - // Column[w0] of type[class org.apache.druid.query.rowsandcols.column.ColumnAccessorBasedColumn] cannot be sorted. @DrillTest("druid_queries/empty_and_non_empty_over/wikipedia_query_1") @Test public void test_empty_and_non_empty_over_wikipedia_query_1() { - sqlNativeIncompatible(); windowQueryTest(); } @@ -7803,4 +7800,18 @@ public class DrillWindowQueryTest extends BaseCalciteQueryTest { windowQueryTest(); } + + @DrillTest("druid_queries/array_concat_agg/only_sorting_column_1") + @Test + public void test_array_concat_agg_with_only_sorting_column_1() + { + windowQueryTest(); + } + + @DrillTest("druid_queries/array_concat_agg/empty_over_1") + @Test + public void test_array_concat_agg_with_empty_over_1() + { + windowQueryTest(); + } } diff --git a/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.e b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.e new file mode 100644 index 00000000000..486bf8740fe --- /dev/null +++ b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.e @@ -0,0 +1 @@ +Guatemala ["Guatemala"] diff --git a/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.q b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.q new file mode 100644 index 00000000000..5448fb8d9be --- /dev/null +++ b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/empty_over_1.q @@ -0,0 +1,4 @@ +select +countryName, array_concat_agg(ARRAY[countryName], 10000) over () as c1 +from wikipedia where countryName='Guatemala' +group by countryName diff --git a/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.e b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.e new file mode 100644 index 00000000000..8757e543a4f --- /dev/null +++ b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.e @@ -0,0 +1,10 @@ +Austria null #de.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria"] +Austria Horsching #de.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria"] +Austria Vienna #de.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria"] +Austria Vienna #es.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria"] +Austria Vienna #tr.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria"] +Republic of Korea null #ko.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea"] +Republic of Korea Jeonju #ko.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea"] +Republic of Korea Seoul #ko.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea"] +Republic of Korea null #en.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea"] +Republic of Korea null #ja.wikipedia ["N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Austria","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea","N/A","Republic of Korea"] diff --git a/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.q b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.q new file mode 100644 index 00000000000..54bb76b1bd2 --- /dev/null +++ b/sql/src/test/resources/drill/window/queries/druid_queries/array_concat_agg/only_sorting_column_1.q @@ -0,0 +1,4 @@ +select countryName, cityName, channel, array_concat_agg(ARRAY['N/A', countryName], 10000) over (order by countryName) as c +from wikipedia +where countryName in ('Austria', 'Republic of Korea') and (cityName in ('Horsching', 'Vienna', 'Seoul', 'Jeonju') or cityName is null) +group by countryName, cityName, channel