Change test name so it triggers in CI (#13844)

As the name of the class did not end or start with "Test", CalciteSelectQueryMSQTest was not triggered in CI. This PR renames the test.
This commit is contained in:
Adarsh Sanjeev 2023-03-20 15:55:52 +05:30 committed by GitHub
parent 1c250a0bc0
commit 143fdcfacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 6 deletions

View File

@ -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<COMPLEX<hyperUnique>>]")
);
}
}
}

View File

@ -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<Object[]> 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<Object[]> 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<Object[]> 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(