feat(session): register object_store backends on SessionContextBuilder#73
Merged
Merged
Conversation
andygrove
approved these changes
May 20, 2026
Member
andygrove
left a comment
There was a problem hiding this comment.
This is awesome! Thanks @LantaoJin
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.
Which issue does this PR close?
registerObjectStorefor S3 / GCS / HTTP backends #70 .Rationale for this change
SessionContext.registerParquet(name, "s3://bucket/...")(and the read/register counterparts for CSV / NDJSON / Arrow / Avro) accept arbitrary path strings, but until this PR there was no Java surface to attach anobject_store::ObjectStoreto a URL scheme + bucket. As a result,s3://,gs://, and remotehttps://paths fail with "No suitable object store found for ..." unless the embedder shells out to process-level environment variables — and even then, multi-tenant JVMs cannot give two contexts different credentials in the same process.DataFusion's Rust
RuntimeEnv::register_object_store(url, store)already solves this end of the problem; the gap was purely in the Java surface above the JNI line. This PR closes it with a typed, per-context registration API:What changes are included in this PR?
proto/object_store_options.protoorg.apache.datafusion.ObjectStoreOptionsnative/src/object_store.rsobject-store-{aws,gcp,http}, withdefault = ["object-store-aws", "object-store-gcp", "object-store-http"]proto/object_store_options.protoAre these changes tested?
23 new tests across
ObjectStoreOptionsTestandSessionContextObjectStoreTestAre there any user-facing changes?
Yes, additive only, no breaking changes:
org.apache.datafusion.ObjectStoreOptions(sealed) with three concrete subtypesS3/Gcs/Httpand per-backend builders. Static factories:ObjectStoreOptions.s3(),.gcs(),.http(listingUrl).SessionContextBuilder.registerObjectStore(ObjectStoreOptions).ObjectStoreRegistration,S3Options,GcsOptions,HttpOptionsunderorg.apache.datafusion.protobuf(consistent with existing options bundles).repeated ObjectStoreRegistration object_stores = 8field onSessionOptions(proto-3 forward compatible — older builds simply ignore it).Existing APIs are unchanged. The
makebuild picks upobject-store-{aws,gcp,http}Cargo features by default; downstream Rust builds that strip a feature trip a clear runtime error if a caller registers the missing backend.