From ef820dbf249d610f11cddad1d48685c562a7d0e9 Mon Sep 17 00:00:00 2001 From: kokila-19 Date: Thu, 23 Jul 2026 17:16:19 +0530 Subject: [PATCH 1/2] HIVE-29764: Set metastore.iceberg.catalog.unique.table.location in the test-docker ConfigMap so createTableInUniqueLocation passes in docker CI. --- itests/test-docker/k8s/hive-metastore/configmap.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/itests/test-docker/k8s/hive-metastore/configmap.yaml b/itests/test-docker/k8s/hive-metastore/configmap.yaml index 72d0ce44762e..625008518ae0 100644 --- a/itests/test-docker/k8s/hive-metastore/configmap.yaml +++ b/itests/test-docker/k8s/hive-metastore/configmap.yaml @@ -41,4 +41,8 @@ data: metastore.catalog.servlet.auth none + + metastore.iceberg.catalog.unique.table.location + true + From 92ea8a33127e1d7dc4038e0ff26d4dd059d97636 Mon Sep 17 00:00:00 2001 From: kokila-19 Date: Fri, 24 Jul 2026 11:24:36 +0530 Subject: [PATCH 2/2] Iceberg: Override testLoadTableWithMissingMetadataFile for missing metadata on S3 Use table.io().deleteFile() instead of Files.move() which does not work on s3a:// paths. --- .../rest/HiveIcebergRESTCatalogTests.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java index 680ef9b5758f..671f3d510ed6 100644 --- a/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java +++ b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java @@ -18,12 +18,19 @@ package org.apache.iceberg.rest; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import java.io.IOException; import java.util.Map; +import org.apache.iceberg.HasTableOperations; +import org.apache.iceberg.Table; import org.apache.iceberg.catalog.CatalogTests; +import org.apache.iceberg.exceptions.NotFoundException; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; class HiveIcebergRESTCatalogTests extends CatalogTests { private static HiveIcebergRESTCatalogClient client; @@ -75,4 +82,33 @@ protected boolean supportsNamesWithSlashes() { protected boolean supportsServerSideRetry() { return true; } + + /** + * Checks that loading a table fails clearly when its metadata file is missing. + * + *

The base Iceberg test moves the metadata file with {@code Files.move()} which only works + * on a local disk. Docker tests store data on S3, so this override deletes the file. + */ + @Test + @Override + public void testLoadTableWithMissingMetadataFile(@TempDir java.nio.file.Path tempDir) + throws IOException { + RESTCatalog catalog = catalog(); + + if (requiresNamespaceCreate()) { + catalog.createNamespace(TBL.namespace()); + } + + catalog.buildTable(TBL, SCHEMA).create(); + assertThat(catalog.tableExists(TBL)).as("Table should exist").isTrue(); + + Table table = catalog.loadTable(TBL); + String metadataFileLocation = + ((HasTableOperations) table).operations().current().metadataFileLocation(); + table.io().deleteFile(metadataFileLocation); + + assertThatThrownBy(() -> catalog.loadTable(TBL)) + .isInstanceOf(NotFoundException.class) + .hasMessageContaining("Failed to open input stream for file: " + metadataFileLocation); + } }