diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java index f0009c12a88c..6d7fd1d3ba38 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java @@ -186,7 +186,7 @@ public Transaction newCreateTableTransaction(ConnectorSession session, SchemaTab @Override public void registerTable(ConnectorSession session, SchemaTableName tableName, String tableLocation, String metadataLocation) { - jdbcCatalog.registerTable(TableIdentifier.of(tableName.getSchemaName(), tableName.getTableName()), metadataLocation); + throw new TrinoException(NOT_SUPPORTED, "registerTable is not supported for Iceberg JDBC catalogs"); } @Override diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/jdbc/TestIcebergJdbcCatalogConnectorSmokeTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/jdbc/TestIcebergJdbcCatalogConnectorSmokeTest.java index 4e2b9986b459..51aeea6d51a1 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/jdbc/TestIcebergJdbcCatalogConnectorSmokeTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/jdbc/TestIcebergJdbcCatalogConnectorSmokeTest.java @@ -54,6 +54,7 @@ protected QueryRunner createQueryRunner() .put("iceberg.catalog.type", "jdbc") .put("iceberg.jdbc-catalog.connection-url", server.getJdbcUrl()) .put("iceberg.jdbc-catalog.catalog-name", "tpch") + .put("iceberg.register-table-procedure.enabled", "true") .buildOrThrow()) .setInitialTables(REQUIRED_TPCH_TABLES) .build(); @@ -97,42 +98,35 @@ protected String getMetadataLocation(String tableName) public void testRegisterTableWithTableLocation() { assertThatThrownBy(super::testRegisterTableWithTableLocation) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg JDBC catalogs"); } @Override public void testRegisterTableWithComments() { assertThatThrownBy(super::testRegisterTableWithComments) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg JDBC catalogs"); } @Override public void testRegisterTableWithShowCreateTable() { assertThatThrownBy(super::testRegisterTableWithShowCreateTable) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg JDBC catalogs"); } @Override public void testRegisterTableWithReInsert() { assertThatThrownBy(super::testRegisterTableWithReInsert) - .hasMessageContaining("register_table procedure is disabled"); - } - - @Override - public void testRegisterTableWithDroppedTable() - { - assertThatThrownBy(super::testRegisterTableWithDroppedTable) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg JDBC catalogs"); } @Override public void testRegisterTableWithDifferentTableName() { assertThatThrownBy(super::testRegisterTableWithDifferentTableName) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg JDBC catalogs"); } @Override diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/rest/TestIcebergRestCatalogConnectorSmokeTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/rest/TestIcebergRestCatalogConnectorSmokeTest.java index 72ebe12515c0..fd9330a06253 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/rest/TestIcebergRestCatalogConnectorSmokeTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/rest/TestIcebergRestCatalogConnectorSmokeTest.java @@ -76,6 +76,7 @@ protected QueryRunner createQueryRunner() .put("iceberg.file-format", format.name()) .put("iceberg.catalog.type", "rest") .put("iceberg.rest-catalog.uri", testServer.getBaseUrl().toString()) + .put("iceberg.register-table-procedure.enabled", "true") .buildOrThrow()) .setInitialTables(REQUIRED_TPCH_TABLES) .build(); @@ -119,42 +120,35 @@ protected String getMetadataLocation(String tableName) public void testRegisterTableWithTableLocation() { assertThatThrownBy(super::testRegisterTableWithTableLocation) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg REST catalog"); } @Override public void testRegisterTableWithComments() { assertThatThrownBy(super::testRegisterTableWithComments) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg REST catalog"); } @Override public void testRegisterTableWithShowCreateTable() { assertThatThrownBy(super::testRegisterTableWithShowCreateTable) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg REST catalog"); } @Override public void testRegisterTableWithReInsert() { assertThatThrownBy(super::testRegisterTableWithReInsert) - .hasMessageContaining("register_table procedure is disabled"); - } - - @Override - public void testRegisterTableWithDroppedTable() - { - assertThatThrownBy(super::testRegisterTableWithDroppedTable) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg REST catalog"); } @Override public void testRegisterTableWithDifferentTableName() { assertThatThrownBy(super::testRegisterTableWithDifferentTableName) - .hasMessageContaining("register_table procedure is disabled"); + .hasMessageContaining("registerTable is not supported for Iceberg REST catalog"); } @Override