You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "danielcweeks (via GitHub)" <gi...@apache.org> on 2025/03/31 19:58:17 UTC

Re: [PR] Core: Pass storage credentials from LoadTableResponse to FileIO [iceberg]

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


##########
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:
   You're right @amogh-jahagirdar, but the first step is to simply plumb through the storage credentials and then we can add support for multiple prefixes.  



-- 
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-unsubscribe@iceberg.apache.org

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


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