diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java index 5c45fbcdf6a..d56afd77468 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java @@ -62,6 +62,7 @@ import org.apache.druid.sql.SqlPlanningException; import org.apache.druid.sql.calcite.expression.DruidExpression; import org.apache.druid.sql.calcite.external.ExternalDataSource; import org.apache.druid.sql.calcite.filtration.Filtration; +import org.apache.druid.sql.calcite.planner.UnsupportedSQLQueryException; import org.apache.druid.sql.calcite.util.CalciteTests; import org.hamcrest.CoreMatchers; import org.junit.Test; @@ -1206,6 +1207,20 @@ public class MSQSelectTest extends MSQTestBase .verifyExecutionError(); } + @Test + public void testGroupByWithComplexColumnThrowsUnsupportedException() + { + testSelectQuery() + .setSql("select unique_dim1 from foo2 group by unique_dim1") + .setQueryContext(context) + .setExpectedExecutionErrorMatcher(CoreMatchers.allOf( + CoreMatchers.instanceOf(UnsupportedSQLQueryException.class), + ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString( + "SQL requires a group-by on a column of type COMPLEX that is unsupported")) + )) + .verifyExecutionError(); + } + @Test public void testGroupByMultiValueMeasureQuery() {