diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveDistributedAggregations.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveDistributedAggregations.java index 13a5fe418f09..7c4c17dc85d6 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveDistributedAggregations.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveDistributedAggregations.java @@ -16,8 +16,6 @@ import io.trino.testing.AbstractTestAggregations; import io.trino.testing.QueryRunner; -import static io.trino.tpch.TpchTable.getTables; - public class TestHiveDistributedAggregations extends AbstractTestAggregations { @@ -26,7 +24,7 @@ protected QueryRunner createQueryRunner() throws Exception { return HiveQueryRunner.builder() - .setInitialTables(getTables()) + .setInitialTables(REQUIRED_TPCH_TABLES) .build(); } } diff --git a/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveFaultTolerantExecutionAggregations.java b/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveFaultTolerantExecutionAggregations.java index 19dcd88fbaac..da94ddc79b67 100644 --- a/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveFaultTolerantExecutionAggregations.java +++ b/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveFaultTolerantExecutionAggregations.java @@ -26,7 +26,6 @@ import static io.trino.plugin.exchange.filesystem.containers.MinioStorage.getExchangeManagerProperties; import static io.trino.testing.TestingNames.randomNameSuffix; -import static io.trino.tpch.TpchTable.getTables; import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; @TestInstance(PER_CLASS) @@ -49,7 +48,7 @@ protected QueryRunner createQueryRunner(Map extraProperties) runner.installPlugin(new FileSystemExchangePlugin()); runner.loadExchangeManager("filesystem", getExchangeManagerProperties(minioStorage)); }) - .setInitialTables(getTables()) + .setInitialTables(REQUIRED_TPCH_TABLES) .build(); } diff --git a/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveRuntimeAdaptivePartitioningFaultTolerantExecutionAggregations.java b/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveRuntimeAdaptivePartitioningFaultTolerantExecutionAggregations.java index e09a4ddff0c3..55765c94c309 100644 --- a/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveRuntimeAdaptivePartitioningFaultTolerantExecutionAggregations.java +++ b/testing/trino-faulttolerant-tests/src/test/java/io/trino/faulttolerant/hive/TestHiveRuntimeAdaptivePartitioningFaultTolerantExecutionAggregations.java @@ -22,8 +22,6 @@ import java.util.Map; -import static io.trino.tpch.TpchTable.getTables; - public class TestHiveRuntimeAdaptivePartitioningFaultTolerantExecutionAggregations extends AbstractTestFaultTolerantExecutionAggregations { @@ -42,7 +40,7 @@ protected QueryRunner createQueryRunner(Map extraProperties) runner.loadExchangeManager("filesystem", ImmutableMap.of("exchange.base-directories", System.getProperty("java.io.tmpdir") + "/trino-local-file-system-exchange-manager")); }) - .setInitialTables(getTables()) + .setInitialTables(REQUIRED_TPCH_TABLES) .build(); } } diff --git a/testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java b/testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java index c1ca47508ad1..6f5c7667d97b 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java @@ -14,21 +14,35 @@ package io.trino.testing; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import io.trino.Session; import io.trino.spi.type.TimeZoneKey; +import io.trino.tpch.TpchTable; import org.intellij.lang.annotations.Language; import org.junit.jupiter.api.Test; import java.util.List; +import java.util.Set; import static io.trino.SystemSessionProperties.MARK_DISTINCT_STRATEGY; import static io.trino.testing.MaterializedResult.resultBuilder; import static io.trino.testing.QueryAssertions.assertEqualsIgnoreOrder; +import static io.trino.tpch.TpchTable.LINE_ITEM; +import static io.trino.tpch.TpchTable.NATION; +import static io.trino.tpch.TpchTable.ORDERS; +import static io.trino.tpch.TpchTable.REGION; import static org.assertj.core.api.Assertions.assertThat; public abstract class AbstractTestAggregations extends AbstractTestQueryFramework { + protected static final Set> REQUIRED_TPCH_TABLES = ImmutableSet.>builder() + .add(LINE_ITEM) + .add(NATION) + .add(ORDERS) + .add(REGION) + .build(); + @Test public void testCountBoolean() {