findinpath commented on code in PR #16536:
URL: https://github.com/apache/iceberg/pull/16536#discussion_r3311067628


##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -181,17 +181,37 @@ public RESTSessionCatalog() {
                 .uri(config.get(CatalogProperties.URI))
                 .withHeaders(RESTUtil.configHeaders(config))
                 .build(),
-        null);
+        (FileIOBuilder) null);
   }
 
   public RESTSessionCatalog(
-      Function<Map<String, String>, RESTClient> clientBuilder,
-      BiFunction<SessionContext, Map<String, String>, FileIO> ioBuilder) {
+      Function<Map<String, String>, RESTClient> clientBuilder, FileIOBuilder 
ioBuilder) {
     Preconditions.checkNotNull(clientBuilder, "Invalid client builder: null");
     this.clientBuilder = clientBuilder;
     this.ioBuilder = ioBuilder;
   }
 
+  /**
+   * @deprecated Use {@link #RESTSessionCatalog(Function, FileIOBuilder)} 
instead.
+   */
+  @Deprecated
+  public RESTSessionCatalog(
+      Function<Map<String, String>, RESTClient> clientBuilder,
+      BiFunction<SessionContext, Map<String, String>, FileIO> ioBuilder) {
+    this(
+        clientBuilder,
+        ioBuilder == null
+            ? null
+            : (context, properties, credentials) -> {
+              FileIO fileIO = ioBuilder.apply(context, properties);
+              if (!credentials.isEmpty()
+                  && fileIO instanceof SupportsStorageCredentials 
ioWithCredentials) {

Review Comment:
   Thank you for the feedback.
   
   I've created an alternative in trinodb/trino which works without any changes 
on `apache/iceberg` `1.11.0`
   
   https://github.com/trinodb/trino/pull/29641
   
   The challenge in `trinodb/trino` is that we are applying 
`SupportsStorageCredentials` on both `ForwardingFileIO` (trino's wrapper for 
`FileIO`) as well as on the `TrinoFileSystem` 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to