[branch-55] fix(ffi): use the session's LogicalExtensionCodec in create_physical_plan (#24690) - #24694
Merged
alamb merged 1 commit intoAug 26, 2026
Conversation
…plan (apache#24690) ## Which issue does this PR close? - Closes apache#24688. ## Rationale for this change A foreign library that holds an FFI session reference cannot call `Session::create_physical_plan` for any plan that references a custom table provider or other extension node. Planning fails with: > This feature is not implemented: LogicalExtensionCodec is not provided ## What changes are included in this PR? In `datafusion/ffi/src/session/mod.rs`, we now serialize and deserialize logical plans using codecs. This matches what `optimize_fn_wrapper` and `ForeignSession::optimize` already do. ## Are these changes tested? Yes. A new unit test, `session::tests::test_create_physical_plan_uses_logical_codec`, registers a `MemTable` that can only be serialized by a custom codec, wraps the session in an `FFI_SessionRef` carrying that codec, and plans a scan of it through `ForeignSession::create_physical_plan`. The test was verified to reproduce the bug: with either half of the fix reverted it fails. ## Are there any user-facing changes? No API changes. `Session::create_physical_plan` over FFI now works for plans that require the session's `LogicalExtensionCodec` instead of returning a not-implemented error. No breaking changes. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
19 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## branch-55 #24694 +/- ##
=============================================
- Coverage 81.16% 81.16% -0.01%
=============================================
Files 1110 1110
Lines 386911 386935 +24
Branches 386911 386935 +24
=============================================
+ Hits 314050 314065 +15
- Misses 54370 54374 +4
- Partials 18491 18496 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
saadtajwar
approved these changes
Aug 26, 2026
alamb
approved these changes
Aug 26, 2026
alamb
left a comment
Contributor
There was a problem hiding this comment.
Thank you @timsaucer and @saadtajwar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a cherry-pick of #24690 onto
branch-55. See the original PR for a description of the issue.