sfc-gh-rxing commented on code in PR #724:
URL: https://github.com/apache/polaris/pull/724#discussion_r1917449506


##########
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -1627,6 +1627,12 @@ private FileIO refreshIOWithCredentials(
     // the credentials should always override table-level properties, since
     // storage configuration will be found at whatever entity defines it
     tableProperties.putAll(credentialsMap);
+
+    // Populate the internal properties to FileIO in case the FileIO 
implementation needs them
+    Map<String, String> internalProperties =
+        
storageInfoEntity.map(PolarisEntity::getInternalPropertiesAsMap).orElse(Map.of());

Review Comment:
   How about introducing a configuration called `ALLOWED_FILE_IO_PROPERTIES`. 
If the property is included in the allowlist, we pass it to FileIO. Otherwise, 
we just filter it. 
   
   Pseudocode:
   ```java
   public void refreshIOWithCredentials(...) {
       // ......
       Map<String, String> additionalProperties = new HashMap<>();
       storageInfoEntity.getInternalProperties().forEach((key, value) -> {
           if (ALLOWED_FILE_IO_PROPERTIES.contains(key)) {
               additionalProperties.put(key, value);
           }
       });
       tableProperties.putAll(additionalProperties);
       FileIO fileIO = null;
       fileIO = loadFileIO(ioImplClassName, tableProperties);
       // ensure the new fileIO is closed when the catalog is closed
       closeableGroup.addCloseable(fileIO);
       return fileIO;
   }
   ```



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