Add unit test for complex column grouping (#13650)

* Add unit test for complex column grouping

Co-authored-by: Karan Kumar <karankumar1100@gmail.com>
This commit is contained in:
Adarsh Sanjeev 2023-01-12 15:25:01 +05:30 committed by GitHub
parent 7f54ebbf47
commit afb3d91777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -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<hyperUnique> that is unsupported"))
))
.verifyExecutionError();
}
@Test
public void testGroupByMultiValueMeasureQuery()
{