mirror of https://github.com/apache/druid.git
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:
parent
668169d9a9
commit
fff3e81dcc
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Guatemala ["Guatemala"]
|
|
@ -0,0 +1,4 @@
|
|||
select
|
||||
countryName, array_concat_agg(ARRAY[countryName], 10000) over () as c1
|
||||
from wikipedia where countryName='Guatemala'
|
||||
group by countryName
|
|
@ -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"]
|
|
@ -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
|
Loading…
Reference in New Issue