Title: feat: expose Substrait plan ingestion via `SessionContext.fromSubstrait` · Issue #75 · apache/datafusion-java · GitHub
Open Graph Title: feat: expose Substrait plan ingestion via `SessionContext.fromSubstrait` · Issue #75 · apache/datafusion-java
X Title: feat: expose Substrait plan ingestion via `SessionContext.fromSubstrait` · Issue #75 · apache/datafusion-java
Description: Is your feature request related to a problem or challenge? SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logical-plan standard that DataFusion already supports through ...
Open Graph Description: Is your feature request related to a problem or challenge? SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logical-plan standard t...
X Description: Is your feature request related to a problem or challenge? SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logical-plan standa...
Opengraph URL: https://github.com/apache/datafusion-java/issues/75
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: expose Substrait plan ingestion via `SessionContext.fromSubstrait`","articleBody":"### Is your feature request related to a problem or challenge?\n\n`SessionContext.fromProto(byte[])` accepts only DataFusion's *own* `LogicalPlanNode` proto. [Substrait](https://substrait.io/) — the cross-engine logical-plan standard that DataFusion already supports through the [`datafusion-substrait`](https://crates.io/crates/datafusion-substrait) crate — has no Java-side entry point.\n\n### Describe the solution you'd like\n\nAdd a single new entry point on `SessionContext`:\n\n```java\npublic DataFrame fromSubstrait(byte[] planBytes);\n```\n\n`planBytes` is a serialized `substrait.proto.Plan` message. The implementation deserialises with `prost`, hands the resulting `Plan` to `datafusion_substrait::logical_plan::consumer::from_substrait_plan(state, &plan).await`, and wraps the resulting `LogicalPlan` in a `DataFrame` exactly the way `fromProto` does for DataFusion's native plan format. From there callers compose the usual `DataFrame` API:\n\n```java\nbyte[] plan = compileWithCalcite(...); // any Substrait-emitting compiler\ntry (DataFrame df = ctx.fromSubstrait(plan);\n ArrowReader reader = df.executeStream(allocator)) {\n while (reader.loadNextBatch()) { /* ... */ }\n}\n```\n\nTo avoid bloating builds for users who don't need it, the `datafusion-substrait` Cargo dependency lives behind a `substrait` Cargo feature on the `datafusion-jni` crate. The feature is on by default — Maven users get Substrait support out of the box — but downstream Rust embedders who strip features can opt out, and the JNI handler returns a clear error if invoked in a build that compiled the feature off.\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n- DataFusion 53.1 pulls `substrait = 0.62.2` (proto schema version). The Rust API is stable for the consumer side: `from_substrait_plan(state: &SessionState, plan: &Plan) -> Result\u003cLogicalPlan>` plus `serializer::deserialize_bytes(Vec\u003cu8>) -> Result\u003cBox\u003cPlan>>` for the wire-format decode.","author":{"url":"https://github.com/LantaoJin","@type":"Person","name":"LantaoJin"},"datePublished":"2026-05-20T10:13:49Z","url":"https://github.com/apache/datafusion-java/issues/75"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67ee9ec4-0827-003d-cdb6-f3eef7d1bb15 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FD4:436BB:2BD8B4:3C428E:6B046A0C |
| html-safe-nonce | 498ff89c9a2473a035ac0db9c9396b24cdb15bf68d75212054f766aa2045d664 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkQ0OjQzNkJCOjJCRDhCNDozQzQyOEU6NkIwNDZBMEMiLCJ2aXNpdG9yX2lkIjoiNTg1NTY0MDkxOTAxNTY5NTQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6f9c907f096ce514a9720a44714017280ef7ea239550972f907061a6fc45fd31 |
| hovercard-subject-tag | issue:4485385117 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/apache/datafusion-java/75/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2544393e24aae548d110cf02a1505c052a53493890249b943985a7ba50869b61/apache/datafusion-java/issues/75 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2544393e24aae548d110cf02a1505c052a53493890249b943985a7ba50869b61/apache/datafusion-java/issues/75 |
| og:image:alt | Is your feature request related to a problem or challenge? SessionContext.fromProto(byte[]) accepts only DataFusion's own LogicalPlanNode proto. Substrait — the cross-engine logical-plan standard t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LantaoJin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width