Add s3_compatible_url_schemes setting to route additional URL schemes to the S3 filesystem#340
Open
plusplusjiajia wants to merge 1 commit into
Open
Add s3_compatible_url_schemes setting to route additional URL schemes to the S3 filesystem#340plusplusjiajia wants to merge 1 commit into
plusplusjiajia wants to merge 1 commit into
Conversation
…chemes to the S3 filesystem
Author
|
Hi @carlopi, could you trigger CI when you get a chance? This generalizes the hardcoded r2:///gcs:// scheme handling into a s3_compatible_url_schemes setting, so S3-compatible stores like oss:// work via their native scheme. No behavior change when unset; tests included. Thanks! |
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.
Motivation
Many object stores are S3-compatible but use their own URL scheme (e.g.
oss://,cos://,obs://). Data lake catalogs (e.g. Iceberg REST catalogs) return table locations using these schemes, which the client cannot control — DuckDB currently fails with "No such file or directory"because no filesystem recognizes the prefix, even though the S3 filesystem could serve these requests via a custom endpoint.
httpfs already handles this pattern for specific vendors with the built-in
r2://andgcs:///gs://schemes. This PR generalizes that into a setting instead of hardcoding more vendor schemes one by one.Changes
s3_compatible_url_schemessetting (VARCHAR, comma-separated): registered schemes are recognized byS3FileSystem::TryGetPrefix/CanHandleFileand included in the default scope of newly created S3 secrets.default_scope = GLOBAL; explicitSET SESSIONis rejected) — URL-to-filesystem routing is instance-level by nature.s3://,gcs://,r2://,http://,https://,hf://,file://, ...) are rejected to prevent hijacking their routing.RESETrestores the default (empty) behavior; covered by tests.Default behavior is unchanged: with the setting unset, routing and secret scopes are identical to before.
Usage