René's URL Explorer Experiment


Title: feat: add SessionContextBuilder.withSparkFunctions for Spark-compatible functions by andygrove · Pull Request #100 · apache/datafusion-java · GitHub

Open Graph Title: feat: add SessionContextBuilder.withSparkFunctions for Spark-compatible functions by andygrove · Pull Request #100 · apache/datafusion-java

X Title: feat: add SessionContextBuilder.withSparkFunctions for Spark-compatible functions by andygrove · Pull Request #100 · apache/datafusion-java

Description: Which issue does this PR close? N/A Rationale for this change DataFusion publishes Apache Spark–compatible functions and expression planners in the datafusion-spark crate, but datafusion-java had no way to use them. This adds an opt-in so Java callers can build a SessionContext whose SQL surface matches Spark semantics (e.g. crc32), without affecting the default context. What changes are included in this PR? Java: a new SessionContextBuilder.withSparkFunctions() setter, carried through the existing SessionOptions protobuf path. It composes with all other builder options; the no-arg new SessionContext() path is unchanged (Spark functions are strictly opt-in). Proto: a new optional bool spark_functions field on SessionOptions. Native: a build_session_context helper that, when the flag is set, builds the context through SessionStateBuilder::with_default_features().with_spark_features() (so Spark implementations override built-ins of the same name). Object-store registration and the memory tracker are preserved. Cargo: the datafusion-spark (v53.1.0, matching the pinned DataFusion) dependency behind a new optional spark feature, included in the default feature set — mirroring the existing object-store feature gating. Builds that strip the feature surface a clear error from the JVM if the flag is requested. Docs: a "Spark-compatible functions" section in the SessionContext user guide. Are these changes tested? Yes. Java: proto round-trip tests for the flag, plus an integration test asserting crc32('Spark') returns 1557323817 with the flag and that the same SQL fails without it (proving the flag is load-bearing). Rust: unit tests gated on the spark feature confirming crc32 is registered when the flag is set and absent otherwise. Full suites pass: Rust cargo test --features spark, JVM ./mvnw -pl core test (334 tests), and cargo clippy --features spark -- -D warnings clean. Verified the native crate also compiles with --no-default-features. Are there any user-facing changes? Yes — a new public SessionContextBuilder.withSparkFunctions() method and accompanying user-guide documentation. No breaking changes to existing APIs.

Open Graph Description: Which issue does this PR close? N/A Rationale for this change DataFusion publishes Apache Spark–compatible functions and expression planners in the datafusion-spark crate, but datafusion-java ha...

X Description: Which issue does this PR close? N/A Rationale for this change DataFusion publishes Apache Spark–compatible functions and expression planners in the datafusion-spark crate, but datafusion-java ha...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

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:d21a3def-ecc9-9ac7-13d7-49e53fd72f04
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD950:91084:5B784B:7D4C45:6B0474C9
html-safe-nonce4ed1f78b92f141540197f5f144b7e584eb4549a0674749425b5af395960f526c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTUwOjkxMDg0OjVCNzg0Qjo3RDRDNDU6NkIwNDc0QzkiLCJ2aXNpdG9yX2lkIjoiODI0MDA0NjQ0NDUzMTQ0Njk4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac246805fb41c541c0cf066f67009e954a747c03e04eb6958764c583fd0656b7e0
hovercard-subject-tagpull_request:3807453265
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/100/files
twitter:imagehttps://avatars.githubusercontent.com/u/934084?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/934084?s=400&v=4
og:image:altWhich issue does this PR close? N/A Rationale for this change DataFusion publishes Apache Spark–compatible functions and expression planners in the datafusion-spark crate, but datafusion-java ha...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
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
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/100/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F100%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%2F100%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/100/files
Reloadhttps://github.com/apache/datafusion-java/pull/100/files
Reloadhttps://github.com/apache/datafusion-java/pull/100/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
andygrove:spark-compatible-functionshttps://github.com/andygrove/datafusion-java/tree/spark-compatible-functions
Conversation 2 https://github.com/apache/datafusion-java/pull/100
Commits 6 https://github.com/apache/datafusion-java/pull/100/commits
Checks 6 https://github.com/apache/datafusion-java/pull/100/checks
Files changed https://github.com/apache/datafusion-java/pull/100/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/100/files
feat: add SessionContextBuilder.withSparkFunctions for Spark-compatible functions https://github.com/apache/datafusion-java/pull/100/files#top
Show all changes 6 commits https://github.com/apache/datafusion-java/pull/100/files
f889243 build(native): add optional datafusion-spark dependency behind spark … andygrove Jun 5, 2026 https://github.com/apache/datafusion-java/pull/100/commits/f889243ed33637a923c58f4dc1e08c92f72d7102
a36c5b3 feat(session): add SessionContextBuilder.withSparkFunctions flag andygrove Jun 5, 2026 https://github.com/apache/datafusion-java/pull/100/commits/a36c5b340b476ab61d575da3a78d255d4dd9b5a2
5cd9bf3 feat(session): register Spark-compatible functions when withSparkFunc… andygrove Jun 5, 2026 https://github.com/apache/datafusion-java/pull/100/commits/5cd9bf39aa032f5d79a962d94498753ba576e3e9
ac34593 test(native): cover Spark function registration in build_session_context andygrove Jun 5, 2026 https://github.com/apache/datafusion-java/pull/100/commits/ac34593e001d8eede4f2690e25cf0610d8acd8c3
6f4e2f9 docs: document SessionContextBuilder.withSparkFunctions andygrove Jun 5, 2026 https://github.com/apache/datafusion-java/pull/100/commits/6f4e2f91069cf33862ec3d5a9a67fe908a781ef7
73dad68 refactor(native): use SessionStateBuilder::new_with_default_features andygrove Jun 10, 2026 https://github.com/apache/datafusion-java/pull/100/commits/73dad6884d8cfff3f322413f7b2d7dd8a442fb99
Clear filters https://github.com/apache/datafusion-java/pull/100/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/100/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/100/files
SessionContextBuilder.java https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
SessionContextBuilderTest.java https://github.com/apache/datafusion-java/pull/100/files#diff-50889426329cdb701cb92d08e0f589a10fb873de977e2485adaf522248e961f2
SessionContextSparkFunctionsTest.java https://github.com/apache/datafusion-java/pull/100/files#diff-b8b1754b6d4c9293aa1a15655202658da429889281322ba5720b6eddfa8b345b
sessioncontext.md https://github.com/apache/datafusion-java/pull/100/files#diff-3bce4be80b83ba41ff0e8ca04cc6f97e2f1027978802a157d8391bea68437543
Cargo.lock https://github.com/apache/datafusion-java/pull/100/files#diff-078f375cfc74d2a2bae74160d7469389a54227046a6daec4edb0481597ec2aa8
Cargo.toml https://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
lib.rs https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
session_options.proto https://github.com/apache/datafusion-java/pull/100/files#diff-0b48e973a751cd44663289ad7c1db4671e9262f89545cf6d4a518d774c1bd904
core/src/main/java/org/apache/datafusion/SessionContextBuilder.javahttps://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/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/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
https://github.com/apache/datafusion-java/pull/100/files#diff-d94f9dc56a90ad2e3f99a7814d387f3c924307f9632b0ea8fe5f4ac2b08a2532
core/src/test/java/org/apache/datafusion/SessionContextBuilderTest.javahttps://github.com/apache/datafusion-java/pull/100/files#diff-50889426329cdb701cb92d08e0f589a10fb873de977e2485adaf522248e961f2
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/core/src/test/java/org/apache/datafusion/SessionContextBuilderTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-50889426329cdb701cb92d08e0f589a10fb873de977e2485adaf522248e961f2
https://github.com/apache/datafusion-java/pull/100/files#diff-50889426329cdb701cb92d08e0f589a10fb873de977e2485adaf522248e961f2
core/src/test/java/org/apache/datafusion/SessionContextSparkFunctionsTest.javahttps://github.com/apache/datafusion-java/pull/100/files#diff-b8b1754b6d4c9293aa1a15655202658da429889281322ba5720b6eddfa8b345b
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/core/src/test/java/org/apache/datafusion/SessionContextSparkFunctionsTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
docs/source/user-guide/sessioncontext.mdhttps://github.com/apache/datafusion-java/pull/100/files#diff-3bce4be80b83ba41ff0e8ca04cc6f97e2f1027978802a157d8391bea68437543
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/docs/source/user-guide/sessioncontext.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-3bce4be80b83ba41ff0e8ca04cc6f97e2f1027978802a157d8391bea68437543
native/Cargo.lockhttps://github.com/apache/datafusion-java/pull/100/files#diff-078f375cfc74d2a2bae74160d7469389a54227046a6daec4edb0481597ec2aa8
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/native/Cargo.lock
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/apache/datafusion-java/pull/100/files
native/Cargo.tomlhttps://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/native/Cargo.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
https://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
https://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
https://github.com/apache/datafusion-java/pull/100/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
native/src/lib.rshttps://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/native/src/lib.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
https://github.com/apache/datafusion-java/pull/100/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
proto/session_options.protohttps://github.com/apache/datafusion-java/pull/100/files#diff-0b48e973a751cd44663289ad7c1db4671e9262f89545cf6d4a518d774c1bd904
View file https://github.com/andygrove/datafusion-java/blob/73dad6884d8cfff3f322413f7b2d7dd8a442fb99/proto/session_options.proto
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/100/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/100/files#diff-0b48e973a751cd44663289ad7c1db4671e9262f89545cf6d4a518d774c1bd904
https://github.com/apache/datafusion-java/pull/100/files#diff-0b48e973a751cd44663289ad7c1db4671e9262f89545cf6d4a518d774c1bd904
Please reload this pagehttps://github.com/apache/datafusion-java/pull/100/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.