René's URL Explorer Experiment


Title: feat: expose ConfigOptions.set/get as generic SessionContextBuilder.setOption / SessionContext.getOption · Issue #48 · apache/datafusion-java · GitHub

Open Graph Title: feat: expose ConfigOptions.set/get as generic SessionContextBuilder.setOption / SessionContext.getOption · Issue #48 · apache/datafusion-java

X Title: feat: expose ConfigOptions.set/get as generic SessionContextBuilder.setOption / SessionContext.getOption · Issue #48 · apache/datafusion-java

Description: Is your feature request related to a problem or challenge? SessionContextBuilder (introduced in #28) exposes a typed setter for the six most-common SessionConfig knobs: batchSize, targetPartitions, collectStatistics, informationSchema, m...

Open Graph Description: Is your feature request related to a problem or challenge? SessionContextBuilder (introduced in #28) exposes a typed setter for the six most-common SessionConfig knobs: batchSize, targetPartitions,...

X Description: Is your feature request related to a problem or challenge? SessionContextBuilder (introduced in #28) exposes a typed setter for the six most-common SessionConfig knobs: batchSize, targetPartitions,...

Opengraph URL: https://github.com/apache/datafusion-java/issues/48

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: expose ConfigOptions.set/get as generic SessionContextBuilder.setOption / SessionContext.getOption","articleBody":"### Is your feature request related to a problem or challenge?\n\n`SessionContextBuilder` (introduced in #28) exposes a typed setter for the six most-common `SessionConfig` knobs: `batchSize`, `targetPartitions`, `collectStatistics`, `informationSchema`, `memoryLimit`, and `tempDirectory`. There is currently no Java surface to **read** any config value back, either.\n\nThe Rust `ConfigOptions` struct that backs `SessionConfig` carries roughly 200 keys split across seven sections (`datafusion.catalog.*`, `datafusion.execution.*`, `datafusion.optimizer.*`, `datafusion.sql_parser.*`, `datafusion.explain.*`, `datafusion.format.*`, plus user `extensions`). The Java builder reaches none of these except the six it names explicitly.\n\nA few representative gaps the *typed* approach would have to fill one at a time, but a *generic* `setOption(key, value)` lights up in a single PR:\n\n- `datafusion.execution.parquet.pushdown_filters` — decode-time predicate pushdown via `RowFilter`. Workload-dependent default; many embedders flip this per-context.\n- `datafusion.execution.parquet.bloom_filter_on_read`, `…parquet.reorder_filters`, `…parquet.schema_force_view_types`, `…parquet.binary_as_string` — the rest of the parquet family.\n- `datafusion.optimizer.prefer_hash_join`, `…optimizer.default_filter_selectivity`, `…optimizer.repartition_joins`, `…optimizer.expand_views_at_output` — optimizer dials almost every embedder ends up tuning.\n- `datafusion.execution.time_zone` — required for any timestamp arithmetic that needs a non-UTC zone.\n- `datafusion.format.timestamp_format`, `…format.date_format`, `…format.binary_format` — affect every `DataFrame.show()` and any text rendering.\n- `datafusion.sql_parser.dialect`, `…sql_parser.enable_ident_normalization` — needed to integrate with non-PostgreSQL frontends (MySQL, Snowflake, Hive, …).\n- `datafusion.explain.show_statistics`, `…explain.show_sizes`, `…explain.format` — needed by tooling/UI built on top of `EXPLAIN`.\n- User `extensions` set via `Extensions::insert(...)` — currently unreachable from Java at any granularity.\n\nDataFusion already exposes string-keyed get/set on its config (`ConfigOptions::set(key, value)` and `ConfigOptions::entries()`). The Java binding can mirror both directly:\n\n```rust\nconfig.options_mut().set(key, value)?;       // ConfigOptions::set\nctx.copied_config().options().entries();     // ConfigOptions::entries\n```\n\nThis issue tracks adding the matching Java surface for both directions.\n\n### Describe the solution you'd like\n\nThree new methods, two on `SessionContextBuilder` and one on `SessionContext`:\n\n```java\nctx.builder()\n    .batchSize(8192)                                       // existing typed\n    .targetPartitions(16)                                  // existing typed\n    .setOption(\"datafusion.execution.parquet.pushdown_filters\", \"true\")\n    .setOption(\"datafusion.optimizer.prefer_hash_join\", \"true\")\n    .setOptions(Map.of(                                    // bulk overload\n        \"datafusion.execution.time_zone\", \"UTC\",\n        \"datafusion.optimizer.default_filter_selectivity\", \"10\"))\n    .build();\n\n// read side, on the constructed context:\nString tz = ctx.getOption(\"datafusion.execution.time_zone\");\n```\n\n### Wire format\n\nPurely additive — one new field on the existing `SessionOptions` proto:\n\n```protobuf\nmessage SessionOptions {\n  optional uint64 batch_size = 1;\n  // ... unchanged ...\n  optional string temp_directory = 6;\n  map\u003cstring, string> options = 7;     // new\n}\n```\n\n`map\u003cstring, string>` over `repeated KeyValue` because:\n- The Java/Rust generated APIs are nicer (`putOptions` / `HashMap\u003cString,String>` rather than a wrapper struct).\n- Each key is unique by definition, which is the constraint we want.\n- Wire bytes are identical to a repeated KV under proto3.\n\n### setOption / setOptions (write side)\n\n```java\npublic SessionContextBuilder setOption(String key, String value) {\n    if (key == null || value == null) {\n        throw new IllegalArgumentException(\"setOption key and value must be non-null\");\n    }\n    this.options.put(key, value);   // LinkedHashMap\u003cString, String>\n    return this;\n}\n\npublic SessionContextBuilder setOptions(Map\u003cString, String> entries) { ... }\n```\n\nStored into a `LinkedHashMap\u003cString, String>` so caller-order is preserved on the Java side; serialized via `b.putAllOptions(...)` into the proto.\n\n### getOption (read side)\n\n```java\npublic String getOption(String key) { ... }\n```\n\nLives on `SessionContext` rather than the builder, because the value it returns is \"what DataFusion actually compiled\" — only knowable post-construction. Returns the value as a `String`, or `null` if the key is recognised but has no value set and no default. Unknown keys throw `RuntimeException` to mirror `setOption`'s strictness, and a closed-context call throws `IllegalStateException` like every other method on the class.\n\nReturning a plain `String` rather than a richer `ConfigEntry { key, value, description }` because the Java side has no `ConfigEntry` mirror today; introducing one is review surface for another day, and a richer return type is purely additive.\n\n### Rust surface\n\nIn `native/src/lib.rs::createSessionContextWithOptions`, after the existing typed-field decoding:\n\n```rust\nlet mut config = SessionConfig::new();\n// ... existing typed setters unchanged ...\nfor (k, v) in &opts.options {\n    config.options_mut().set(k, v)?;\n}\n```\n\nPlus a new `getOptionNative` JNI handler that walks `ctx.copied_config().options().entries()` and returns the matching `entry.value` as a `JString`, or `null` for known-but-unset.\n\n`ConfigOptions::set` returns a `DataFusionError` on unknown keys or unparseable values, which `try_unwrap_or_throw` already surfaces as a `RuntimeException` with the underlying message — same error path as the rest of the JNI crate.\n\n### Behavior precedence\n\nMap entries are applied **after** the typed setters, so a caller that sets both `batchSize(8192)` and `setOption(\"datafusion.execution.batch_size\", \"1\")` gets the overriding behavior. This is the only semantically defensible order (otherwise the typed-setter-wins case would silently drop the explicit `setOption` call), but flagged here for explicit reviewer sign-off — see *Open questions* below.\n\n### Out of scope (separate follow-ups)\n\n- Read-time options like `CsvReadOptions.has_header` — per-call, already typed, not session-level.\n- Compile-time validation of keys. Java has no way to know whether a key string is valid in the pinned DataFusion version; we rely on the runtime error from `ConfigOptions::set`. Same UX as the Rust string-keyed API.\n- A typed `ConfigException` hierarchy. Today every JNI error collapses to `RuntimeException`. Promoting these to typed exceptions is a separate cross-cutting concern.\n- A `listOptions()` enumerator returning all keys. Useful for tooling but not needed by users; easy follow-up if requested.\n\n\n### Out of scope (separate follow-ups)\n\n- Read-time options like `CsvReadOptions.has_header` per-call, already typed, not session-level.\n- Compile-time validation of keys. Java has no way to know whether a key string is valid in the pinned DataFusion version; we rely on the runtime error from `ConfigOptions::set`. Same UX as the Rust string-keyed API.\n- A typed `ConfigException` hierarchy. Today every JNI error collapses to `RuntimeException`. Promoting these to typed exceptions is a separate cross-cutting concern (see related work in `prs/CONTRIB_ISSUES.md` #12 in the OpenSearch-sourced backlog).\n\n### Describe alternatives you've considered\n\n1. **One named setter per key**, e.g. `parquetPushdownFilters(boolean)`. Originally drafted as the first cut. Rejected because it scales to ~200 setters and forces a separate PR for every new dial DataFusion adds upstream. Named setters for the *common* knobs (the six already in #28) are the right call; a generic escape hatch covers the long tail.\n\n2. **A bundled `parquetOptions(ParquetSessionOptions)` builder per-section.** Decent ergonomics but loses everything outside parquet, and forces us to re-design the surface every time DataFusion adds a section. The `setOption(key, value)` shape tracks the upstream API exactly and needs no follow-up when new keys are added.\n\n3. **getOption on the builder instead of on `SessionContext`.** Considered but rejected: a builder-side getter would only know what's pending in the local map, which is strictly worse than reading what DataFusion actually compiled. The post-construction `SessionContext.getOption` is the meaningful contract.\n\n4. **Returning `null` for unknown keys instead of throwing.** Conflates \"no such key\" (caller typo) with \"known-but-unset\" (legitimate state). Throwing on unknown keys matches `setOption`'s strictness and gives faster feedback on typos.\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/LantaoJin","@type":"Person","name":"LantaoJin"},"datePublished":"2026-05-14T06:07:24Z","url":"https://github.com/apache/datafusion-java/issues/48"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:33a76208-8be7-ebfc-504e-5f13913bf881
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8FD2:208411:2E1FDC:3F5A77:6B046A0B
html-safe-nonce764de4e4304f5573b856ea5fec3f02625514379cbc6760b5ae1aa5631e029785
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkQyOjIwODQxMToyRTFGREM6M0Y1QTc3OjZCMDQ2QTBCIiwidmlzaXRvcl9pZCI6IjQwOTI4MDExODU3MTc5NzE0NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac30463e7d65f3750d704e4f3d4d203962cb63c689f6cb62716a308e0a5640cb56
hovercard-subject-tagissue:4443643995
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/datafusion-java/48/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0aacdd0b048fe5d1b033192c86bb1f37b2c128b2e60962cee680da96e348d626/apache/datafusion-java/issues/48
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0aacdd0b048fe5d1b033192c86bb1f37b2c128b2e60962cee680da96e348d626/apache/datafusion-java/issues/48
og:image:altIs your feature request related to a problem or challenge? SessionContextBuilder (introduced in #28) exposes a typed setter for the six most-common SessionConfig knobs: batchSize, targetPartitions,...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameLantaoJin
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/apache/datafusion-java/issues/48#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fissues%2F48
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%2Fissues%2F48
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/issues/48
Reloadhttps://github.com/apache/datafusion-java/issues/48
Reloadhttps://github.com/apache/datafusion-java/issues/48
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
https://github.com/apache/datafusion-java
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/48
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/48
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
#49https://github.com/apache/datafusion-java/pull/49
feat: expose ConfigOptions.set/get as generic SessionContextBuilder.setOption / SessionContext.getOptionhttps://github.com/apache/datafusion-java/issues/48#top
#49https://github.com/apache/datafusion-java/pull/49
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/LantaoJin
LantaoJinhttps://github.com/LantaoJin
on May 14, 2026https://github.com/apache/datafusion-java/issues/48#issue-4443643995
#28https://github.com/apache/datafusion-java/pull/28
Add test section to README #12https://github.com/apache/datafusion-java/pull/12
feat: configure SessionContext and RuntimeEnv via builder #28https://github.com/apache/datafusion-java/pull/28
LantaoJinhttps://github.com/LantaoJin
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
on May 14, 2026https://github.com/apache/datafusion-java/issues/48#event-25516055806
LantaoJinhttps://github.com/LantaoJin
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
on May 14, 2026https://github.com/apache/datafusion-java/issues/48#event-25516057852
LantaoJinhttps://github.com/LantaoJin
on May 14, 2026https://github.com/apache/datafusion-java/issues/48#event-25517157687
andygrovehttps://github.com/andygrove
completedhttps://github.com/apache/datafusion-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#49https://github.com/apache/datafusion-java/pull/49
on May 14, 2026https://github.com/apache/datafusion-java/issues/48#event-25536118005
Sign up for freehttps://github.com/signup?return_to=https://github.com/apache/datafusion-java/issues/48
Sign in to commenthttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/48
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.