René's URL Explorer Experiment


Title: feat(builder): expose ConfigOptions.set/get as setOption / setOptions / getOption by LantaoJin · Pull Request #49 · apache/datafusion-java · GitHub

Open Graph Title: feat(builder): expose ConfigOptions.set/get as setOption / setOptions / getOption by LantaoJin · Pull Request #49 · apache/datafusion-java

X Title: feat(builder): expose ConfigOptions.set/get as setOption / setOptions / getOption by LantaoJin · Pull Request #49 · apache/datafusion-java

Description: Which issue does this PR close? Closes #48 . Rationale for this change SessionContextBuilder (introduced in #28) currently exposes typed setters for the six most-common session knobs: batchSize, targetPartitions, collectStatistics, informationSchema, memoryLimit, and tempDirectory. The Rust DataFusion configuration surface backing these is roughly 200 keys split across seven sections under SessionConfig (datafusion.catalog.*, datafusion.execution.*, datafusion.optimizer.*, datafusion.sql_parser.*, datafusion.explain.*, datafusion.format.*, plus user extensions). The Java builder reaches none of those except the six it names explicitly, and there is no Java surface to read any config value back at all. DataFusion already exposes a string-keyed setter for these (ConfigOptions::set(key, value)). This PR mirrors that surface in Java rather than adding ~200 named setters one at a time. What changes are included in this PR? Two additions to the existing SessionOptions proto: a new repeated ConfigOption options = 7; field plus the ConfigOption { key, value } message. No existing field changes; wire format stays backward and forward compatible. repeated is used instead of map because protobuf maps decode into HashMap on the Rust side, whose iteration order is randomized — that would silently break overlapping-key cases like datafusion.optimizer.enable_dynamic_filter_pushdown (which has side effects on the per-operator enable_*_dynamic_filter_pushdown flags). Two new methods on SessionContextBuilder: setOption(String key, String value) — single entry. setOptions(Map entries) — bulk apply. One new method on SessionContext: getOption(String key) → String — read the current value of any datafusion.* config key. Returns the value as a string, or null if the key is recognised but has no value set and no default. Throws RuntimeException on unknown keys (mirrors setOption's strictness for fast feedback on typos), and IllegalStateException when called on a closed context. Native side: free-form options are applied via config.options_mut().set(k, v)? before the SessionContext is constructed, so the typed batchSize/targetPartitions/etc setters can be overridden by an explicit setOption for the same key. getOptionNative walks ctx.copied_config().options().entries(). The Rust calls use the ? form (rather than SessionConfig::set_str(...).unwrap()) so unknown keys or unparseable values surface as a RuntimeException on the Java side carrying DataFusion's error message, instead of panicking the JVM. What's intentionally out of scope: datafusion.runtime.* keys datafusion.runtime.* keys (memory limit, temp directory, cache sizes, list-files-cache TTL) live on a separate RuntimeEnv config object. Round-tripping them through getOption/setOption has several upstream-shaped correctness pitfalls that don't apply to the session-config subtree (lazy default tempdir creation that materializes a path the user never set, per-session datafusion-Xxxxxx spill suffixes, OS-specific path separators, integer K/M/G truncation that loses fractional capacities, sub-1KB values formatted as bare bytes, the unlimited sentinel, and disk-manager state being clobbered when multiple runtime keys are routed through SET). Doing them right needs a per-context side-cache of the user's verbatim values. This PR rejects datafusion.runtime.* in both setOption and getOption with a clear error pointing at the typed memoryLimit / tempDirectory setters. Adding round-trippable runtime support is tracked as a separate follow-up. Apply order for setOption Map entries are applied after typed setters by design — otherwise a caller writing both batchSize(8192) and setOption("datafusion.execution.batch_size", "1024") would have their explicit setOption silently dropped. The opposite order would make setOption strictly weaker than the typed setters and give callers no way to override. Among setOption calls themselves, entries are applied in caller insertion order (first call applied first). The Java side stores entries in a LinkedHashMap, the proto field is repeated (preserves order on the wire), and the Rust side iterates a Vec (preserves order on apply). Caller's last write wins for both same-key duplicates and overlapping side-effect keys. Why getOption lives on SessionContext, not the builder The value getOption returns is "what DataFusion actually compiled". That's only knowable post-construction, so the read-side method belongs on the constructed SessionContext. A builder-side getter would only return what's pending in the local map, which is a strictly worse signal. Are these changes tested? Yes — 14 new tests in SessionContextBuilderTest, bringing the file from 5 to 19 tests total. All pass. Are there any user-facing changes? Yes — purely additive. New public API: SessionContextBuilder.setOption(String, String) SessionContextBuilder.setOptions(Map) SessionContextBuilder.setOptions(LinkedHashMap) SessionContext.getOption(String) → String The new options field is also exposed on the existing org.apache.datafusion.protobuf.SessionOptions generated class (getOptionsMap() etc.). No API removals, no deprecations, no behavior change for callers who don't call any of the new methods.

Open Graph Description: Which issue does this PR close? Closes #48 . Rationale for this change SessionContextBuilder (introduced in #28) currently exposes typed setters for the six most-common session knobs: batchSize...

X Description: Which issue does this PR close? Closes #48 . Rationale for this change SessionContextBuilder (introduced in #28) currently exposes typed setters for the six most-common session knobs: batchSize...

Opengraph URL: https://github.com/apache/datafusion-java/pull/49

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:74956f83-aa74-e783-cd99-5e332f9c68c0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDF6C:81334:4E1E:6773:6B046A53
html-safe-nonce8008596b7a045b5e24902489116d249b304858304dc35c925992057823ead94c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjZDOjgxMzM0OjRFMUU6Njc3Mzo2QjA0NkE1MyIsInZpc2l0b3JfaWQiOiIxNzUyODY3MjkwMjA0MTA1Mjk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9eaf1c91e7dc71f5f35d51836255c29becd9b821cfbf3932946ceaab4f0cdcf9
hovercard-subject-tagpull_request:3681143170
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/49/files
twitter:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
og:image:altWhich issue does this PR close? Closes #48 . Rationale for this change SessionContextBuilder (introduced in #28) currently exposes typed setters for the six most-common session knobs: batchSize...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id1237105117
octolytics-dimension-repository_nwoapache/datafusion-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1237105117
octolytics-dimension-repository_network_root_nwoapache/datafusion-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/49/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F49%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F49%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/pull/49/files
Reloadhttps://github.com/apache/datafusion-java/pull/49/files
Reloadhttps://github.com/apache/datafusion-java/pull/49/files
apachehttps://github.com/apache
datafusion-javahttps://github.com/apache/datafusion-java
Codehttps://github.com/apache/datafusion-java
Issues10 (10)https://github.com/apache/datafusion-java/issues
Pull requests10 (10)https://github.com/apache/datafusion-java/pulls
Discussionshttps://github.com/apache/datafusion-java/discussions
Actionshttps://github.com/apache/datafusion-java/actions
Security and qualityhttps://github.com/apache/datafusion-java/security
Insightshttps://github.com/apache/datafusion-java/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
andygrovehttps://github.com/andygrove
apache:mainhttps://github.com/apache/datafusion-java/tree/main
LantaoJin:feat/session-set-optionhttps://github.com/LantaoJin/datafusion-java/tree/feat/session-set-option
Conversation 1 https://github.com/apache/datafusion-java/pull/49
Commits 1 https://github.com/apache/datafusion-java/pull/49/commits
Checks 1 https://github.com/apache/datafusion-java/pull/49/checks
Files changed https://github.com/apache/datafusion-java/pull/49/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/49/files
feat(builder): expose ConfigOptions.set/get as setOption / setOptions / getOption https://github.com/apache/datafusion-java/pull/49/files#top
Show all changes 1 commit https://github.com/apache/datafusion-java/pull/49/files
304ef6e feat(builder): expose ConfigOptions.set/get as setOption / setOptions… LantaoJin May 14, 2026 https://github.com/apache/datafusion-java/pull/49/commits/304ef6e551cfb4470c8dc87fbda598a39754b2e4
Clear filters https://github.com/apache/datafusion-java/pull/49/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/49/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/49/files
SessionContext.java https://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
SessionContextBuilder.java https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
SessionContextBuilderTest.java https://github.com/apache/datafusion-java/pull/49/files#diff-50889426329cdb701cb92d08e0f589a10fb873de977e2485adaf522248e961f2
lib.rs https://github.com/apache/datafusion-java/pull/49/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
session_options.proto https://github.com/apache/datafusion-java/pull/49/files#diff-0b48e973a751cd44663289ad7c1db4671e9262f89545cf6d4a518d774c1bd904
core/src/main/java/org/apache/datafusion/SessionContext.javahttps://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
View file https://github.com/LantaoJin/datafusion-java/blob/304ef6e551cfb4470c8dc87fbda598a39754b2e4/core/src/main/java/org/apache/datafusion/SessionContext.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/49/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/49/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
core/src/main/java/org/apache/datafusion/SessionContextBuilder.javahttps://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
View file https://github.com/LantaoJin/datafusion-java/blob/304ef6e551cfb4470c8dc87fbda598a39754b2e4/core/src/main/java/org/apache/datafusion/SessionContextBuilder.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/49/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/49/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
Please reload this pagehttps://github.com/apache/datafusion-java/pull/49/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/49/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.