diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryTestMSQ.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java similarity index 81% rename from extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryTestMSQ.java rename to extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java index 9d31d4f2062..1f45b6ca160 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryTestMSQ.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java @@ -20,9 +20,11 @@ package org.apache.druid.msq.test; import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.ImmutableList; import com.google.inject.Injector; import com.google.inject.Module; import org.apache.druid.guice.DruidInjectorBuilder; +import org.apache.druid.java.util.common.ISE; import org.apache.druid.msq.exec.WorkerMemoryParameters; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.query.groupby.TestGroupByBuffers; @@ -31,13 +33,15 @@ import org.apache.druid.sql.calcite.CalciteQueryTest; import org.apache.druid.sql.calcite.QueryTestBuilder; import org.apache.druid.sql.calcite.run.SqlEngine; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; +import org.junit.Test; /** * Runs {@link CalciteQueryTest} but with MSQ engine */ -public class CalciteSelectQueryTestMSQ extends CalciteQueryTest +public class CalciteSelectQueryMSQTest extends CalciteQueryTest { private TestGroupByBuffers groupByBuffers; @@ -160,4 +164,23 @@ public class CalciteSelectQueryTestMSQ extends CalciteQueryTest } + /** + * Same query as {@link CalciteQueryTest#testArrayAggQueryOnComplexDatatypes}. ARRAY_AGG is not supported in MSQ currently. + * Once support is added, this test can be removed and msqCompatible() can be added to the one in CalciteQueryTest. + */ + @Test + @Override + public void testArrayAggQueryOnComplexDatatypes() + { + msqCompatible(); + try { + testQuery("SELECT ARRAY_AGG(unique_dim1) FROM druid.foo", ImmutableList.of(), ImmutableList.of()); + Assert.fail("query execution should fail"); + } + catch (ISE e) { + Assert.assertTrue( + e.getMessage().contains("Cannot handle column [a0] with type [ARRAY>]") + ); + } + } } 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 88df7939340..78e2e50f3b7 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 @@ -3550,7 +3550,8 @@ public class CalciteQueryTest extends BaseCalciteQueryTest @Test public void testNullDoubleTopN() { - msqCompatible(); + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + // msqCompatible(); List expected; if (useDefault) { expected = ImmutableList.of( @@ -3591,7 +3592,8 @@ public class CalciteQueryTest extends BaseCalciteQueryTest @Test public void testNullFloatTopN() { - msqCompatible(); + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + // msqCompatible(); List expected; if (useDefault) { expected = ImmutableList.of( @@ -3632,7 +3634,8 @@ public class CalciteQueryTest extends BaseCalciteQueryTest @Test public void testNullLongTopN() { - msqCompatible(); + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + // msqCompatible(); List expected; if (useDefault) { expected = ImmutableList.of( @@ -5698,6 +5701,11 @@ public class CalciteQueryTest extends BaseCalciteQueryTest ); } + /** + * Same query as {@link org.apache.druid.msq.test.CalciteSelectQueryMSQTest#testArrayAggQueryOnComplexDatatypes()}. + * ARRAY_AGG is not supported in MSQ currently, but is supported as sql-native. Once support is added, + * the overriding test can be removed and msqCompatible() can be added here instead. + */ @Test public void testArrayAggQueryOnComplexDatatypes() { @@ -6607,7 +6615,8 @@ public class CalciteQueryTest extends BaseCalciteQueryTest { // When HLL is disabled, APPROX_COUNT_DISTINCT is still approximate. - msqCompatible(); + // Disabled test in MSQ till https://github.com/apache/druid/issues/13950 is resolved + // msqCompatible(); testQuery( PLANNER_CONFIG_NO_HLL, "SELECT APPROX_COUNT_DISTINCT(dim2) FROM druid.foo", @@ -6640,7 +6649,8 @@ public class CalciteQueryTest extends BaseCalciteQueryTest @Test public void testApproxCountDistinctBuiltin() { - msqCompatible(); + // Disabled test in MSQ till https://github.com/apache/druid/issues/13950 is resolved + // msqCompatible(); testQuery( "SELECT APPROX_COUNT_DISTINCT_BUILTIN(dim2) FROM druid.foo", ImmutableList.of(