nastra commented on code in PR #12591:
URL: https://github.com/apache/iceberg/pull/12591#discussion_r2011508059


##########
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java:
##########
@@ -80,7 +81,24 @@ public TableMetadata tableMetadata() {
   }
 
   public Map<String, String> config() {
-    return config != null ? config : ImmutableMap.of();
+    Map<String, String> conf = config != null ? config : ImmutableMap.of();
+    List<Credential> storageCredentials = credentials();
+    if (!storageCredentials.isEmpty()) {
+      List<Credential> creds = Lists.newLinkedList(storageCredentials);
+      for (Credential credential : storageCredentials) {
+        // only keep the credentials with the longest prefix
+        creds.removeIf(
+            cred ->
+                credential.prefix().length() > cred.prefix().length()
+                    && credential.prefix().startsWith(cred.prefix()));
+      }

Review Comment:
   > I think it'd require more plumbing through FileIO. Or not sure if we're 
trying to solve something different here
   
   In the long run we'd definitely need to do some plumbing so that e.g. 
S3FileIO is properly configured for different credential prefixes. I talked 
with @danielcweeks last week and the current goal here was to basically use the 
credentials that come back in the `storage-credentials` field in 
`LoadTableResponse` and merge those into the normal `config`, since in the spec 
we say that whatever in `storage-credentials` is should be used before looking 
into whatever is in the `config`



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to