collado-mike commented on code in PR #1378:
URL: https://github.com/apache/polaris/pull/1378#discussion_r2049376651


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -1328,6 +1346,41 @@ public void doCommit(TableMetadata base, TableMetadata 
metadata) {
       String newLocation = writeNewMetadataIfRequired(base == null, metadata);
       String oldLocation = base == null ? null : base.metadataFileLocation();
 
+      // TODO: we should not need to do this hack, but there's no other way to 
modify
+      // currentMetadata / currentMetadataLocation

Review Comment:
   Yeah, understood. But `BaseMetastoreTableOperations` is an inner class of 
`IcebergCatalog`. It can read any field defined in `IcebergCatalog`, so we can 
just create a Map that is written to during `commitTable` and then when we call 
`ops().current()`, we can just read the map value. We can also store the 
TableMetadata with 
`TableMetadata.buildFrom(metadata).withMetadataLocation(latestMetadataLocation)`
 in the commit function. No reflection necessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to