From 4a46e5456668faaf65406d6a591ae21c83590d1d Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Mon, 21 Feb 2022 10:39:55 +0900 Subject: [PATCH 1/3] Rename TestRaptorIntegrationSmokeTest to TestRaptorConnectorTest This is a preparatory commit for migrating to BaseConnectorTest. --- ...orIntegrationSmokeTest.java => TestRaptorConnectorTest.java} | 2 +- .../raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java | 2 +- .../raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/{TestRaptorIntegrationSmokeTest.java => TestRaptorConnectorTest.java} (99%) diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java similarity index 99% rename from plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java rename to plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java index 3366f3ff68d4..296e9aeb0b4c 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java @@ -57,7 +57,7 @@ import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; -public class TestRaptorIntegrationSmokeTest +public class TestRaptorConnectorTest // TODO extend BaseConnectorTest extends AbstractTestIntegrationSmokeTest { diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java index f5275fbc88fd..f7a9e8300389 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java @@ -22,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class TestRaptorIntegrationSmokeTestBucketed - extends TestRaptorIntegrationSmokeTest + extends TestRaptorConnectorTest { @Override protected QueryRunner createQueryRunner() diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java index 7a7ed2ee6ff3..9de9ee403ab6 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java @@ -29,7 +29,7 @@ import static java.lang.String.format; public class TestRaptorIntegrationSmokeTestMySql - extends TestRaptorIntegrationSmokeTest + extends TestRaptorConnectorTest { private MySQLContainer mysqlContainer; From 3dcd7754fcd91cd25321afd383b7552393c3ebba Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Mon, 21 Feb 2022 10:43:21 +0900 Subject: [PATCH 2/3] Make TestRaptorConnectorTest abstract --- ...Test.java => BaseRaptorConnectorTest.java} | 13 +------- .../TestRaptorIntegrationSmokeTest.java | 31 +++++++++++++++++++ ...estRaptorIntegrationSmokeTestBucketed.java | 2 +- .../TestRaptorIntegrationSmokeTestMySql.java | 2 +- 4 files changed, 34 insertions(+), 14 deletions(-) rename plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/{TestRaptorConnectorTest.java => BaseRaptorConnectorTest.java} (98%) create mode 100644 plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java similarity index 98% rename from plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java rename to plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java index 296e9aeb0b4c..f7a5cf60297e 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java @@ -15,15 +15,12 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.SetMultimap; import io.trino.spi.type.ArrayType; import io.trino.testing.AbstractTestIntegrationSmokeTest; import io.trino.testing.MaterializedResult; import io.trino.testing.MaterializedRow; -import io.trino.testing.QueryRunner; import io.trino.testng.services.Flaky; -import io.trino.tpch.TpchTable; import org.intellij.lang.annotations.Language; import org.testng.annotations.Test; @@ -43,7 +40,6 @@ import static io.airlift.testing.Assertions.assertInstanceOf; import static io.airlift.testing.Assertions.assertLessThan; import static io.trino.plugin.raptor.legacy.RaptorColumnHandle.SHARD_UUID_COLUMN_TYPE; -import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; import static io.trino.spi.type.BigintType.BIGINT; import static io.trino.spi.type.BooleanType.BOOLEAN; import static io.trino.spi.type.DateType.DATE; @@ -57,17 +53,10 @@ import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; -public class TestRaptorConnectorTest +public abstract class BaseRaptorConnectorTest // TODO extend BaseConnectorTest extends AbstractTestIntegrationSmokeTest { - @Override - protected QueryRunner createQueryRunner() - throws Exception - { - return createRaptorQueryRunner(ImmutableMap.of(), TpchTable.getTables(), false, ImmutableMap.of()); - } - @Test public void testCreateArrayTable() { diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java new file mode 100644 index 000000000000..ee358b704b8e --- /dev/null +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java @@ -0,0 +1,31 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.trino.plugin.raptor.legacy; + +import com.google.common.collect.ImmutableMap; +import io.trino.testing.QueryRunner; +import io.trino.tpch.TpchTable; + +import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; + +public class TestRaptorIntegrationSmokeTest + extends BaseRaptorConnectorTest +{ + @Override + protected QueryRunner createQueryRunner() + throws Exception + { + return createRaptorQueryRunner(ImmutableMap.of(), TpchTable.getTables(), false, ImmutableMap.of()); + } +} diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java index f7a9e8300389..2dd8dcf7310e 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java @@ -22,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class TestRaptorIntegrationSmokeTestBucketed - extends TestRaptorConnectorTest + extends BaseRaptorConnectorTest { @Override protected QueryRunner createQueryRunner() diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java index 9de9ee403ab6..c3c794710f22 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java @@ -29,7 +29,7 @@ import static java.lang.String.format; public class TestRaptorIntegrationSmokeTestMySql - extends TestRaptorConnectorTest + extends BaseRaptorConnectorTest { private MySQLContainer mysqlContainer; From 955bd4b05476eb5d933b411b7acfee821898575d Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Mon, 21 Feb 2022 11:06:39 +0900 Subject: [PATCH 3/3] Migrate Raptor to use BaseConnectorTest --- .../legacy/BaseRaptorConnectorTest.java | 103 ++++++++++++++++-- ...a => TestRaptorBucketedConnectorTest.java} | 5 +- ...Test.java => TestRaptorConnectorTest.java} | 5 +- .../legacy/TestRaptorDistributedQueries.java | 87 --------------- .../TestRaptorDistributedQueriesBucketed.java | 31 ------ ...java => TestRaptorMySqlConnectorTest.java} | 5 +- 6 files changed, 102 insertions(+), 134 deletions(-) rename plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/{TestRaptorIntegrationSmokeTestBucketed.java => TestRaptorBucketedConnectorTest.java} (92%) rename plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/{TestRaptorIntegrationSmokeTest.java => TestRaptorConnectorTest.java} (83%) delete mode 100644 plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueries.java delete mode 100644 plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueriesBucketed.java rename plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/{TestRaptorIntegrationSmokeTestMySql.java => TestRaptorMySqlConnectorTest.java} (96%) diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java index f7a5cf60297e..ca82b34c9e74 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/BaseRaptorConnectorTest.java @@ -17,17 +17,21 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.SetMultimap; import io.trino.spi.type.ArrayType; -import io.trino.testing.AbstractTestIntegrationSmokeTest; +import io.trino.testing.BaseConnectorTest; import io.trino.testing.MaterializedResult; import io.trino.testing.MaterializedRow; +import io.trino.testing.TestingConnectorBehavior; +import io.trino.testing.sql.TestTable; import io.trino.testng.services.Flaky; import org.intellij.lang.annotations.Language; +import org.testng.SkipException; import org.testng.annotations.Test; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Collection; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.StringJoiner; import java.util.UUID; @@ -45,18 +49,103 @@ import static io.trino.spi.type.DateType.DATE; import static io.trino.spi.type.IntegerType.INTEGER; import static io.trino.spi.type.VarcharType.VARCHAR; +import static io.trino.testing.sql.TestTable.randomTableSuffix; import static java.lang.String.format; import static java.util.Arrays.asList; import static java.util.function.Function.identity; import static java.util.stream.Collectors.toSet; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; public abstract class BaseRaptorConnectorTest - // TODO extend BaseConnectorTest - extends AbstractTestIntegrationSmokeTest + extends BaseConnectorTest { + @Override + protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior) + { + switch (connectorBehavior) { + case SUPPORTS_DELETE: + case SUPPORTS_CREATE_VIEW: + return true; + case SUPPORTS_CREATE_SCHEMA: + case SUPPORTS_RENAME_SCHEMA: + case SUPPORTS_COMMENT_ON_TABLE: + case SUPPORTS_COMMENT_ON_COLUMN: + case SUPPORTS_NOT_NULL_CONSTRAINT: + case SUPPORTS_TOPN_PUSHDOWN: + return false; + default: + return super.hasBehavior(connectorBehavior); + } + } + + @Override + protected TestTable createTableWithDefaultColumns() + { + throw new SkipException("Raptor connector does not support column default values"); + } + + @Test + @Override + public void testCharVarcharComparison() + { + assertThatThrownBy(super::testCharVarcharComparison) + .hasMessage("No storage type for type: char(3)"); + } + + @Test + @Override + public void testRenameTableAcrossSchema() + { + // Raptor allows renaming to a schema it doesn't exist https://github.com/trinodb/trino/issues/11110 + String tableName = "test_rename_old_" + randomTableSuffix(); + assertUpdate("CREATE TABLE " + tableName + " AS SELECT 123 x", 1); + + String schemaName = "test_schema_" + randomTableSuffix(); + + String renamedTable = schemaName + ".test_rename_new_" + randomTableSuffix(); + assertUpdate("ALTER TABLE " + tableName + " RENAME TO " + renamedTable); + + assertFalse(getQueryRunner().tableExists(getSession(), tableName)); + assertQuery("SELECT x FROM " + renamedTable, "VALUES 123"); + + assertUpdate("DROP TABLE " + renamedTable); + + assertFalse(getQueryRunner().tableExists(getSession(), tableName)); + assertFalse(getQueryRunner().tableExists(getSession(), renamedTable)); + } + + @Override + protected Optional filterDataMappingSmokeTestData(DataMappingTestSetup dataMappingTestSetup) + { + String typeName = dataMappingTestSetup.getTrinoTypeName(); + if (typeName.equals("tinyint") + || typeName.equals("real") + || typeName.startsWith("decimal(") + || typeName.equals("time") + || typeName.equals("timestamp(3) with time zone") + || typeName.startsWith("char(")) { + //TODO this should either work or fail cleanly + return Optional.empty(); + } + + return Optional.of(dataMappingTestSetup); + } + + @Override + protected Optional filterCaseSensitiveDataMappingTestData(DataMappingTestSetup dataMappingTestSetup) + { + String typeName = dataMappingTestSetup.getTrinoTypeName(); + if (typeName.equals("char(1)")) { + //TODO this should either work or fail cleanly + return Optional.empty(); + } + return Optional.of(dataMappingTestSetup); + } + @Test public void testCreateArrayTable() { @@ -294,12 +383,12 @@ public void testShardsSystemTable() "SELECT table_schema, table_name, sum(row_count)\n" + "FROM system.shards\n" + "WHERE table_schema = 'tpch'\n" + - " AND table_name IN ('orders', 'lineitem')\n" + + " AND table_name IN ('orders', 'region')\n" + "GROUP BY 1, 2", "" + "SELECT 'tpch', 'orders', (SELECT count(*) FROM orders)\n" + "UNION ALL\n" + - "SELECT 'tpch', 'lineitem', (SELECT count(*) FROM lineitem)"); + "SELECT 'tpch', 'region', (SELECT count(*) FROM region)"); } @Test @@ -660,12 +749,12 @@ public void testTableStatsSystemTable() "SELECT table_schema, table_name, sum(row_count)\n" + "FROM system.table_stats\n" + "WHERE table_schema = 'tpch'\n" + - " AND table_name IN ('orders', 'lineitem')\n" + + " AND table_name IN ('orders', 'region')\n" + "GROUP BY 1, 2", "" + "SELECT 'tpch', 'orders', (SELECT count(*) FROM orders)\n" + "UNION ALL\n" + - "SELECT 'tpch', 'lineitem', (SELECT count(*) FROM lineitem)"); + "SELECT 'tpch', 'region', (SELECT count(*) FROM region)"); assertQuery("" + "SELECT\n" + diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorBucketedConnectorTest.java similarity index 92% rename from plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java rename to plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorBucketedConnectorTest.java index 2dd8dcf7310e..960bddfc3284 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestBucketed.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorBucketedConnectorTest.java @@ -15,20 +15,19 @@ import com.google.common.collect.ImmutableMap; import io.trino.testing.QueryRunner; -import io.trino.tpch.TpchTable; import org.testng.annotations.Test; import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; import static org.assertj.core.api.Assertions.assertThat; -public class TestRaptorIntegrationSmokeTestBucketed +public class TestRaptorBucketedConnectorTest extends BaseRaptorConnectorTest { @Override protected QueryRunner createQueryRunner() throws Exception { - return createRaptorQueryRunner(ImmutableMap.of(), TpchTable.getTables(), true, ImmutableMap.of()); + return createRaptorQueryRunner(ImmutableMap.of(), REQUIRED_TPCH_TABLES, true, ImmutableMap.of()); } @Test diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java similarity index 83% rename from plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java rename to plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java index ee358b704b8e..ce99a6be5ca7 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTest.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorConnectorTest.java @@ -15,17 +15,16 @@ import com.google.common.collect.ImmutableMap; import io.trino.testing.QueryRunner; -import io.trino.tpch.TpchTable; import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; -public class TestRaptorIntegrationSmokeTest +public class TestRaptorConnectorTest extends BaseRaptorConnectorTest { @Override protected QueryRunner createQueryRunner() throws Exception { - return createRaptorQueryRunner(ImmutableMap.of(), TpchTable.getTables(), false, ImmutableMap.of()); + return createRaptorQueryRunner(ImmutableMap.of(), REQUIRED_TPCH_TABLES, false, ImmutableMap.of()); } } diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueries.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueries.java deleted file mode 100644 index 44b819044f42..000000000000 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueries.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.trino.plugin.raptor.legacy; - -import com.google.common.collect.ImmutableMap; -import io.trino.testing.AbstractTestDistributedQueries; -import io.trino.testing.QueryRunner; -import io.trino.testing.sql.TestTable; -import org.testng.SkipException; - -import java.util.Optional; - -import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; - -public class TestRaptorDistributedQueries - extends AbstractTestDistributedQueries -{ - @Override - protected QueryRunner createQueryRunner() - throws Exception - { - return createRaptorQueryRunner(ImmutableMap.of(), REQUIRED_TPCH_TABLES, false, ImmutableMap.of()); - } - - @Override - protected boolean supportsCreateSchema() - { - return false; - } - - @Override - protected boolean supportsCommentOnTable() - { - return false; - } - - @Override - protected boolean supportsCommentOnColumn() - { - return false; - } - - @Override - protected TestTable createTableWithDefaultColumns() - { - throw new SkipException("Raptor connector does not support column default values"); - } - - @Override - protected Optional filterDataMappingSmokeTestData(DataMappingTestSetup dataMappingTestSetup) - { - String typeName = dataMappingTestSetup.getTrinoTypeName(); - if (typeName.equals("tinyint") - || typeName.equals("real") - || typeName.startsWith("decimal(") - || typeName.equals("time") - || typeName.equals("timestamp(3) with time zone") - || typeName.startsWith("char(")) { - // TODO this should either work or fail cleanly - return Optional.empty(); - } - - return Optional.of(dataMappingTestSetup); - } - - @Override - protected Optional filterCaseSensitiveDataMappingTestData(DataMappingTestSetup dataMappingTestSetup) - { - String typeName = dataMappingTestSetup.getTrinoTypeName(); - if (typeName.equals("char(1)")) { - // TODO this should either work or fail cleanly - return Optional.empty(); - } - return Optional.of(dataMappingTestSetup); - } -} diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueriesBucketed.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueriesBucketed.java deleted file mode 100644 index e5b08ecec127..000000000000 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorDistributedQueriesBucketed.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.trino.plugin.raptor.legacy; - -import com.google.common.collect.ImmutableMap; -import io.trino.testing.QueryRunner; -import io.trino.tpch.TpchTable; - -import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createRaptorQueryRunner; - -public class TestRaptorDistributedQueriesBucketed - extends TestRaptorDistributedQueries -{ - @Override - protected QueryRunner createQueryRunner() - throws Exception - { - return createRaptorQueryRunner(ImmutableMap.of(), TpchTable.getTables(), true, ImmutableMap.of()); - } -} diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorMySqlConnectorTest.java similarity index 96% rename from plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java rename to plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorMySqlConnectorTest.java index c3c794710f22..a574f05ce072 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorIntegrationSmokeTestMySql.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/TestRaptorMySqlConnectorTest.java @@ -17,7 +17,6 @@ import io.trino.plugin.tpch.TpchPlugin; import io.trino.testing.DistributedQueryRunner; import io.trino.testing.QueryRunner; -import io.trino.tpch.TpchTable; import org.testcontainers.containers.MySQLContainer; import org.testng.annotations.AfterClass; @@ -28,7 +27,7 @@ import static io.trino.plugin.raptor.legacy.RaptorQueryRunner.createSession; import static java.lang.String.format; -public class TestRaptorIntegrationSmokeTestMySql +public class TestRaptorMySqlConnectorTest extends BaseRaptorConnectorTest { private MySQLContainer mysqlContainer; @@ -77,7 +76,7 @@ private static QueryRunner createRaptorMySqlQueryRunner(String mysqlUrl) queryRunner.createCatalog("raptor", "raptor-legacy", raptorProperties); - copyTables(queryRunner, "tpch", createSession(), false, TpchTable.getTables()); + copyTables(queryRunner, "tpch", createSession(), false, REQUIRED_TPCH_TABLES); return queryRunner; }