diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/AbstractKuduWithStandardInferSchemaConnectorTest.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/AbstractKuduWithStandardInferSchemaConnectorTest.java index b8f49b4fe811..6e44ec4fdad8 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/AbstractKuduWithStandardInferSchemaConnectorTest.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/AbstractKuduWithStandardInferSchemaConnectorTest.java @@ -17,6 +17,7 @@ import java.util.Optional; +import static io.trino.testing.sql.TestTable.randomTableSuffix; import static org.testng.Assert.assertEquals; public abstract class AbstractKuduWithStandardInferSchemaConnectorTest @@ -33,4 +34,22 @@ public void testListingOfTableForDefaultSchema() { assertEquals(computeActual("SHOW TABLES FROM default").getRowCount(), 0); } + + @Test + @Override + public void testDropNonEmptySchema() + { + // Set column and table properties in CREATE TABLE statement + String schemaName = "test_drop_non_empty_schema_" + randomTableSuffix(); + + try { + assertUpdate("CREATE SCHEMA " + schemaName); + assertUpdate("CREATE TABLE " + schemaName + ".t(x int WITH (primary_key=true)) WITH (partition_by_hash_columns=ARRAY['x'], partition_by_hash_buckets=2)"); + assertQueryFails("DROP SCHEMA " + schemaName, ".*Cannot drop non-empty schema '\\Q" + schemaName + "\\E'"); + } + finally { + assertUpdate("DROP TABLE IF EXISTS " + schemaName + ".t"); + assertUpdate("DROP SCHEMA IF EXISTS " + schemaName); + } + } } diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduSmokeTests.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduConnectorTests.java similarity index 93% rename from plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduSmokeTests.java rename to plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduConnectorTests.java index b7c92c325a7f..eb0c12faacf8 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduSmokeTests.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduConnectorTests.java @@ -13,7 +13,7 @@ */ package io.trino.plugin.kudu; -public class KuduSmokeTests +public class KuduConnectorTests { private static final String KUDU_VERSION = "1.13.0"; @@ -37,7 +37,7 @@ protected String getKuduServerVersion() } } - public static class TestKuduSmokeTestWithStandardInferSchema + public static class TestKuduWithStandardInferSchemaConnectorTest extends AbstractKuduWithStandardInferSchemaConnectorTest { @Override diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduLatestConnectorTests.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduLatestConnectorTests.java index 88d09e72e81d..8977dbcae834 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduLatestConnectorTests.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduLatestConnectorTests.java @@ -37,7 +37,7 @@ protected String getKuduServerVersion() } } - public static class TestKuduSmokeTestWithStandardInferSchema + public static class TestKuduWithStandardInferSchemaConnectorTest extends AbstractKuduWithStandardInferSchemaConnectorTest { @Override