This is an automated email from the ASF dual-hosted git repository.

deniskuzZ pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new eb0ea730493 HIVE-29764: Fix Build and Publish docker images in Actions 
after Iceberg Upgrade (#6638)
eb0ea730493 is described below

commit eb0ea730493e9a5ee8db47ac7def6188bc07775e
Author: kokila-19 <[email protected]>
AuthorDate: Thu Jul 30 00:44:02 2026 +0530

    HIVE-29764: Fix Build and Publish docker images in Actions after Iceberg 
Upgrade (#6638)
---
 .../test-docker/k8s/hive-metastore/configmap.yaml  |  4 +++
 .../iceberg/rest/HiveIcebergRESTCatalogTests.java  | 36 ++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/itests/test-docker/k8s/hive-metastore/configmap.yaml 
b/itests/test-docker/k8s/hive-metastore/configmap.yaml
index 72d0ce44762..625008518ae 100644
--- a/itests/test-docker/k8s/hive-metastore/configmap.yaml
+++ b/itests/test-docker/k8s/hive-metastore/configmap.yaml
@@ -41,4 +41,8 @@ data:
         <name>metastore.catalog.servlet.auth</name>
         <value>none</value>
       </property>
+      <property>
+        <name>metastore.iceberg.catalog.unique.table.location</name>
+        <value>true</value>
+      </property>
     </configuration>
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 680ef9b5758..671f3d510ed 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<RESTCatalog> {
   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.
+   *
+   * <p>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);
+  }
 }

Reply via email to