eric-maynard commented on code in PR #1378:
URL: https://github.com/apache/polaris/pull/1378#discussion_r2048445031


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -1328,6 +1344,25 @@ 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
+      // metadataFileLocation / currentMetadataLocation
+      if (updateMetadataOnCommit) {
+        try {
+          Field tableMetadataField = 
TableMetadata.class.getDeclaredField("metadataFileLocation");
+          tableMetadataField.setAccessible(true);
+          tableMetadataField.set(metadata, newLocation);

Review Comment:
   What actually initiates the reload, yes. Coming back to 
`IcebergCatalog.registerTable`, we return the `TableOperations` object wrapped 
in a `BaseTable`:
   ```
       return new BaseTable(ops, fullTableName(name(), identifier), 
metricsReporter());
   ```
   
   Then, coming up a layer to `IcebergCatalogHandler`, we see that the actual 
call is to:
   ```
       return CatalogHandlers.registerTable(baseCatalog, namespace, request);
   ``` 
   
   Which in turn takes the result of `IcebergCatalog.registerTable` and does:
   ```
         return LoadTableResponse.builder()
             .withTableMetadata(((BaseTable) table).operations().current())
             .build();
   ```
   
   This `TableOperations.current()` call will trigger a refresh as 
`requestRefresh` was set on it previously



-- 
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