René's URL Explorer Experiment


Title: feat(substrait): add SessionContext.fromSubstrait gated behind opt-in Cargo feature by LantaoJin · Pull Request #80 · apache/datafusion-java · GitHub

Open Graph Title: feat(substrait): add SessionContext.fromSubstrait gated behind opt-in Cargo feature by LantaoJin · Pull Request #80 · apache/datafusion-java

X Title: feat(substrait): add SessionContext.fromSubstrait gated behind opt-in Cargo feature by LantaoJin · Pull Request #80 · apache/datafusion-java

Description: Which issue does this PR close? Closes #75 . Rationale for this change SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logical-plan standard that DataFusion already supports through the datafusion-substrait crate — has had no Java-side entry point. Embedders that compile plans elsewhere (Calcite via Isthmus, custom planners, federation hubs, integrations with other engines) had to round-trip through SQL to use the Java binding. That round-trip is lossy: source-side optimisations baked into the Substrait plan are discarded, and SQL is not always expressive enough to round-trip cleanly when plans reference extensions or function variants with no surface SQL form. What changes are included in this PR? This PR adds a single new entry point that mirrors the existing fromProto shape but consumes Substrait Plan bytes instead. The implementation is small (~50 LOC of JNI plus ~25 LOC on the Java side); the bulk of the diff is the test that round-trips a hand-built Substrait plan through the JNI bridge. New public Java API on SessionContext: public DataFrame fromSubstrait(byte[] planBytes); planBytes is a serialised substrait.proto.Plan. The plan is translated against this context's catalog: any tables it references must already be registered. The returned DataFrame is lazy and composes with the rest of the API. Default-off, so cargo build (and therefore make test, make, and everyone who doesn't need Substrait) stays hermetic without any new build prerequisites. Substrait support is opt-in: invocation substrait support build prereqs cargo build (default) off (stub handler) none cargo build --features substrait on protoc on PATH cargo build --features substrait,protoc on (vendored protoc) cmake on PATH The Java surface is unchanged either way — SessionContext.fromSubstrait(...) is always present; calls just throw a clear "datafusion-jni was built without the substrait Cargo feature; rebuild with --features substrait" error from the JVM if the feature was compiled off. SessionContextSubstraitTest detects this case and skips itself via JUnit's Assumptions.assumeFalse(...), so make test stays green either way. This is intentionally different from PR #60's avro handling, which is always-on. Are these changes tested? Yes, 7 new tests in SessionContextSubstraitTest Are there any user-facing changes? Yes, purely additive. New public API: SessionContext.fromSubstrait(byte[]) → DataFrame No API removals, no deprecations, no behavior change for existing callers. The default cargo build does not pull in datafusion-substrait and adds no new build prerequisites; SessionContext.fromSubstrait(...) is present but throws "feature not enabled" at runtime. Users who need Substrait rebuild with --features substrait (and either install protoc or also enable the protoc helper feature). The native binary is unchanged in size unless the feature is opted in. The new test-scope dependency io.substrait:core:0.81.0 is added to the parent POM's dependencyManagement (with version property substrait.java.version) and to core/pom.xml in test scope only; it does not enter the runtime classpath of the published artifact.

Open Graph Description: Which issue does this PR close? Closes #75 . Rationale for this change SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logic...

X Description: Which issue does this PR close? Closes #75 . Rationale for this change SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine l...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.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:58e32bb2-9904-8201-9e10-c54bb87343c3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD382:2D5850:3F4A61:58C5DD:6B046F2D
html-safe-nonce0dee115c4308bf0aa3ec122669d59b5accb15b84c083dc640d58fd7aa93cd1a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzgyOjJENTg1MDozRjRBNjE6NThDNUREOjZCMDQ2RjJEIiwidmlzaXRvcl9pZCI6IjQ0NDk4ODM5OTc5MDgyNjY3OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac983c0c95f1cb435cfdfb28e33790766378b3424ee0d5ab882f4e76b55fe594b3
hovercard-subject-tagpull_request:3721396620
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/80/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 #75 . Rationale for this change SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logic...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/80/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F80%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%2F80%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/80/files
Reloadhttps://github.com/apache/datafusion-java/pull/80/files
Reloadhttps://github.com/apache/datafusion-java/pull/80/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/substrait-from-byteshttps://github.com/LantaoJin/datafusion-java/tree/feat/substrait-from-bytes
Conversation 1 https://github.com/apache/datafusion-java/pull/80
Commits 2 https://github.com/apache/datafusion-java/pull/80/commits
Checks 1 https://github.com/apache/datafusion-java/pull/80/checks
Files changed https://github.com/apache/datafusion-java/pull/80/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/80/files
feat(substrait): add SessionContext.fromSubstrait gated behind opt-in Cargo feature https://github.com/apache/datafusion-java/pull/80/files#top
Show all changes 2 commits https://github.com/apache/datafusion-java/pull/80/files
d2b16d3 feat(substrait): add SessionContext.fromSubstrait gated behind opt-in… LantaoJin May 21, 2026 https://github.com/apache/datafusion-java/pull/80/commits/d2b16d31dbbbc2cd1b611ecdad54dae719a509e0
7cf5eac Merge remote-tracking branch 'upstream/main' into feat/substrait-from… LantaoJin May 26, 2026 https://github.com/apache/datafusion-java/pull/80/commits/7cf5eacba92c573646553b6d047a682c737bf7df
Clear filters https://github.com/apache/datafusion-java/pull/80/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/80/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/80/files
pom.xml https://github.com/apache/datafusion-java/pull/80/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
SessionContext.java https://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
SessionContextSubstraitTest.java https://github.com/apache/datafusion-java/pull/80/files#diff-e1707200bb987b3b5af59b0ca29102888912bcc5e1349d3afcfd94e9c944438a
Cargo.lock https://github.com/apache/datafusion-java/pull/80/files#diff-078f375cfc74d2a2bae74160d7469389a54227046a6daec4edb0481597ec2aa8
Cargo.toml https://github.com/apache/datafusion-java/pull/80/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
proto.rs https://github.com/apache/datafusion-java/pull/80/files#diff-e847a473c74bbc8868045519d6d687c837f2647658b05992afdb532009179907
pom.xml https://github.com/apache/datafusion-java/pull/80/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8
core/pom.xmlhttps://github.com/apache/datafusion-java/pull/80/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
View file https://github.com/LantaoJin/datafusion-java/blob/7cf5eacba92c573646553b6d047a682c737bf7df/core/pom.xml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/80/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/80/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
https://github.com/apache/datafusion-java/pull/80/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
core/src/main/java/org/apache/datafusion/SessionContext.javahttps://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
View file https://github.com/LantaoJin/datafusion-java/blob/7cf5eacba92c573646553b6d047a682c737bf7df/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/80/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/80/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
core/src/test/java/org/apache/datafusion/SessionContextSubstraitTest.javahttps://github.com/apache/datafusion-java/pull/80/files#diff-e1707200bb987b3b5af59b0ca29102888912bcc5e1349d3afcfd94e9c944438a
View file https://github.com/LantaoJin/datafusion-java/blob/7cf5eacba92c573646553b6d047a682c737bf7df/core/src/test/java/org/apache/datafusion/SessionContextSubstraitTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/80/{{ revealButtonHref }}
Please reload this pagehttps://github.com/apache/datafusion-java/pull/80/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/80/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.