MonkeyCanCode commented on code in PR #3494:
URL: https://github.com/apache/polaris/pull/3494#discussion_r2722492749


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -1409,6 +1409,22 @@ public void doRefresh() {
                       Set.of(PolarisStorageActions.READ, 
PolarisStorageActions.LIST));
               return TableMetadataParser.read(fileIO, metadataLocation);
             });
+
+        // After a refresh, re-load the FileIO with the new table metadata 
properties to
+        // ensure the right permissions are present for subsequent file system 
interactions.
+        if (currentMetadata != null) {
+          tableFileIO =
+              loadFileIOForTableLike(
+                  tableIdentifier,
+                  StorageUtil.getLocationsUsedByTable(currentMetadata),
+                  resolvedEntities,
+                  new HashMap<>(currentMetadata.properties()),
+                  Set.of(
+                      PolarisStorageActions.READ,
+                      PolarisStorageActions.WRITE,
+                      PolarisStorageActions.LIST));

Review Comment:
   That is an interesting view as Polaris can be use as a RO catalog which it 
may ended up throwing error (as I don't have a setup that reporter has to fully 
test this). In that case, I would think we may want to pick one of the 
following routes instead of the solution above:
   1. use separate reader/writer FileIO
   2. create new FileIO per operation
   
   I can also looking into to see if I can get a similar setup up 
(unfortunately, there is no minimal reproducible provided by reporter).  



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