Title: feat(session): register object_store backends on SessionContextBuilder by LantaoJin · Pull Request #73 · apache/datafusion-java · GitHub
Open Graph Title: feat(session): register object_store backends on SessionContextBuilder by LantaoJin · Pull Request #73 · apache/datafusion-java
X Title: feat(session): register object_store backends on SessionContextBuilder by LantaoJin · Pull Request #73 · apache/datafusion-java
Description: Which issue does this PR close? Closes #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 an object_store::ObjectStore to a URL scheme + bucket. As a result, s3://, gs://, and remote https:// 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: SessionContext ctx = SessionContext.builder() .registerObjectStore(ObjectStoreOptions.s3() .bucket("my-bucket").region("us-east-1") .accessKeyId("...").secretAccessKey("...").build()) .registerObjectStore(ObjectStoreOptions.s3() .bucket("other").endpoint("https://minio.internal:9000") .allowHttp(true).build()) .build(); ctx.registerParquet("orders", "s3://my-bucket/orders/"); What changes are included in this PR? Proto: new proto/object_store_options.proto Java API: new org.apache.datafusion.ObjectStoreOptions Native: new native/src/object_store.rs Cargo features: object-store-{aws,gcp,http}, with default = ["object-store-aws", "object-store-gcp", "object-store-http"] Build wiring: proto/object_store_options.proto Are these changes tested? 23 new tests across ObjectStoreOptionsTest and SessionContextObjectStoreTest Are there any user-facing changes? Yes, additive only, no breaking changes: New public class org.apache.datafusion.ObjectStoreOptions (sealed) with three concrete subtypes S3 / Gcs / Http and per-backend builders. Static factories: ObjectStoreOptions.s3(), .gcs(), .http(listingUrl). New public method SessionContextBuilder.registerObjectStore(ObjectStoreOptions). Generated protobuf classes ObjectStoreRegistration, S3Options, GcsOptions, HttpOptions under org.apache.datafusion.protobuf (consistent with existing options bundles). New repeated ObjectStoreRegistration object_stores = 8 field on SessionOptions (proto-3 forward compatible — older builds simply ignore it). Existing APIs are unchanged. The make build picks up object-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.
Open Graph Description: Which issue does this PR close? Closes #70 . Rationale for this change SessionContext.registerParquet(name, "s3://bucket/...") (and the read/register counterparts for CSV / NDJSON / Arr...
X Description: Which issue does this PR close? Closes #70 . Rationale for this change SessionContext.registerParquet(name, "s3://bucket/...") (and the read/register counterparts for CSV / NDJS...
Opengraph URL: https://github.com/apache/datafusion-java/pull/73
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:02bda51d-e780-4c65-8fcf-052ed858a1e7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 990E:20EE9C:286F36:396626:6B046A3B |
| html-safe-nonce | 8eb5573536bca01ad826c8dd993cd19416a90c46638299ef7ec786028b795f77 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTBFOjIwRUU5QzoyODZGMzY6Mzk2NjI2OjZCMDQ2QTNCIiwidmlzaXRvcl9pZCI6IjY4NDI2OTAxNzM0OTE1MDU3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f0a57d3782f1533ef97e58d17a2331f85123504556a7b118ec0c889964ef4b0 |
| hovercard-subject-tag | pull_request:3715530857 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/73/files |
| twitter:image | https://avatars.githubusercontent.com/u/1853780?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1853780?s=400&v=4 |
| og:image:alt | Which issue does this PR close? Closes #70 . Rationale for this change SessionContext.registerParquet(name, "s3://bucket/...") (and the read/register counterparts for CSV / NDJSON / Arr... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 1237105117 |
| octolytics-dimension-repository_nwo | apache/datafusion-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1237105117 |
| octolytics-dimension-repository_network_root_nwo | apache/datafusion-java |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width