XJDKC commented on code in PR #724:
URL: https://github.com/apache/polaris/pull/724#discussion_r1917600948
##########
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:
Passing the `PolarisResolvedPathWrapper` / `CallContext` to FileIOFactory is
a great suggestion!
Compared to passing the allowed internalProperties, it brings two benefits:
* **`FileIOFactory` as the Translation Layer**:
* For the allowed properties solution, `refreshIOWithCredentials` only
performs basic translation by filtering internalProperties, which is very
inflexible.
* Moving the translation logic to FileIOFactory enables more complex and
flexible handling of the info.
* **Bringing All Necessary Information While Preventing Key Conflicts**:
* By passing the `PolarisResolvedPathWrapper` and `CallContext` to
`FileIOFactory`, it ensures all necessary information is passed and available
for processing, enhancing flexibility and helping to avoid potential key
conflicts.
Since `FileIOFactory` is a Polaris interface, Polaris has full control over
its handling. For FileIOFactories in OSS Polaris, OSS community should proper
process of the passed objects. While for custom `FileIOFactory`, handling is
the responsibility of the Polaris customizer.
--
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]