Add window function drill tests for array_concat_agg for empty over scenarios (#17026)

* Add window function drill tests for array_concat_agg for empty over scenarios

* Cleanup sqlNativeIncompatible() as it's not needed now

* Address review comment
This commit is contained in:
Akshat Jain 2024-09-13 11:35:45 +05:30 committed by GitHub
parent 668169d9a9
commit fff3e81dcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 33 additions and 8 deletions

View File

@ -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");

View File

@ -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();
}
}

View File

@ -0,0 +1 @@
Guatemala ["Guatemala"]

View File

@ -0,0 +1,4 @@
select
countryName, array_concat_agg(ARRAY[countryName], 10000) over () as c1
from wikipedia where countryName='Guatemala'
group by countryName

View File

@ -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"]

View File

@ -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