REST: introduce FileIOBuilder to pass storage credentials at construction time#16536
Open
findinpath wants to merge 1 commit into
Open
REST: introduce FileIOBuilder to pass storage credentials at construction time#16536findinpath wants to merge 1 commit into
findinpath wants to merge 1 commit into
Conversation
…tion time The existing BiFunction<SessionContext, Map<String, String>, FileIO> ioBuilder applied storage credentials post-construction via SupportsStorageCredential.setCredentials method which does not work for engines (e.g. Trino) that need all inputs available at build time. Introduce a FileIOBuilder functional interface that receives SessionContext, fileIO properties, and List<StorageCredential> all at once. Deprecate the BiFunction constructor with a wrapper that preserves the old two-step behavior for existing callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The existing
BiFunction<SessionContext, Map<String, String>, FileIO> ioBuilderapplied storage credentials post-construction viaSupportsStorageCredential.setCredentialsmethodwhich does not work for engines (e.g. Trino) that need all inputs available at build time.
Technical solution
Introduce a
FileIOBuilderfunctional interface that receivesSessionContext, fileIO properties, andList<StorageCredential>all at once. Deprecate theBiFunctionconstructor with a wrapper that preserves the old two-step behavior for existing callers.Related issues and PRs
This contribution is attempting to adjust the previous changes performed in #15752 for configuring
StorageCredentialsin theioBuilder.Issue discovered while developing trinodb/trino#29590
The Trino PR makes use of this contribution for ensuring the accuracy of these changes on https://github.com/trinodb/trino project within the Iceberg connector.