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

singhpk234 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new de8cadfa4 Add location propertiesfrom TableMetadata into Table entity 
internalProperties (#3226)
de8cadfa4 is described below

commit de8cadfa40c583a3530af7900e78a974976c5996
Author: Prashant Singh <[email protected]>
AuthorDate: Mon Feb 9 15:56:12 2026 -0800

    Add location propertiesfrom TableMetadata into Table entity 
internalProperties (#3226)
---
 .../polaris/service/catalog/iceberg/IcebergCatalog.java | 11 +++++++++++
 .../catalog/iceberg/AbstractIcebergCatalogTest.java     | 17 +++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git 
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java
 
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java
index 46020d103..4f7434da3 100644
--- 
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java
+++ 
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java
@@ -1681,7 +1681,18 @@ public class IcebergCatalog extends 
BaseMetastoreViewCatalog
 
   private static Map<String, String> 
buildTableMetadataPropertiesMap(TableMetadata metadata) {
     Map<String, String> storedProperties = new HashMap<>();
+    // Location specific properties
     storedProperties.put(IcebergTableLikeEntity.LOCATION, metadata.location());
+    if 
(metadata.properties().containsKey(TableProperties.WRITE_DATA_LOCATION)) {
+      storedProperties.put(
+          IcebergTableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY,
+          metadata.properties().get(TableProperties.WRITE_DATA_LOCATION));
+    }
+    if 
(metadata.properties().containsKey(TableProperties.WRITE_METADATA_LOCATION)) {
+      storedProperties.put(
+          IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY,
+          metadata.properties().get(TableProperties.WRITE_METADATA_LOCATION));
+    }
     storedProperties.put(
         IcebergTableLikeEntity.FORMAT_VERSION, 
String.valueOf(metadata.formatVersion()));
     storedProperties.put(IcebergTableLikeEntity.TABLE_UUID, metadata.uuid());
diff --git 
a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java
 
b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java
index 2f4fbfd18..49bac1989 100644
--- 
a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java
+++ 
b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java
@@ -72,6 +72,7 @@ import org.apache.iceberg.Table;
 import org.apache.iceberg.TableMetadata;
 import org.apache.iceberg.TableMetadataParser;
 import org.apache.iceberg.TableOperations;
+import org.apache.iceberg.TableProperties;
 import org.apache.iceberg.UpdateRequirement;
 import org.apache.iceberg.UpdateRequirements;
 import org.apache.iceberg.UpdateSchema;
@@ -2271,6 +2272,16 @@ public abstract class AbstractIcebergCatalogTest extends 
CatalogTests<IcebergCat
     catalog.createNamespace(NS);
     catalog.buildTable(TABLE, SCHEMA).create();
     catalog.loadTable(TABLE).newFastAppend().appendFile(FILE_A).commit();
+    catalog
+        .loadTable(TABLE)
+        .updateProperties()
+        .set(
+            TableProperties.WRITE_DATA_LOCATION,
+            "s3://my-bucket/path/to/data/newdb/newtable/my-data")
+        .set(
+            TableProperties.WRITE_METADATA_LOCATION,
+            "s3://my-bucket/path/to/data/newdb/newtable/my-metadata")
+        .commit();
     Table afterAppend = catalog.loadTable(TABLE);
     EntityResult schemaResult =
         metaStoreManager.readEntityByName(
@@ -2297,6 +2308,12 @@ public abstract class AbstractIcebergCatalogTest extends 
CatalogTests<IcebergCat
             IcebergTableLikeEntity.CURRENT_SNAPSHOT_ID,
             String.valueOf(afterAppend.currentSnapshot().snapshotId()))
         .containsEntry(IcebergTableLikeEntity.LOCATION, afterAppend.location())
+        .containsEntry(
+            IcebergTableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY,
+            afterAppend.properties().get(TableProperties.WRITE_DATA_LOCATION))
+        .containsEntry(
+            IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY,
+            
afterAppend.properties().get(TableProperties.WRITE_METADATA_LOCATION))
         .containsEntry(IcebergTableLikeEntity.TABLE_UUID, 
afterAppend.uuid().toString())
         .containsEntry(
             IcebergTableLikeEntity.CURRENT_SCHEMA_ID,

Reply via email to