You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit abc5ce7
Browse filesBrowse the repository at this point in the historyBrowse files
Proto: migrate MemorySourceConfig to per-source try_to_proto / try_from_proto hooks (apache#24187)
## Which issue does this PR close?
- Closesapache#23518.
- Part of apache#23494.
## Rationale for this change
Continues the per-plan proto hook migration (apache#23494, pattern established
in apache#23495 and apache#23683): each plan/source owns its wire logic via
`try_to_proto` / `try_from_proto` hooks instead of the central
downcast/match chains in `datafusion-proto`.
## What changes are included in this PR?
- `DataSource::try_to_proto` implemented for `MemorySourceConfig` and
inherent `MemorySourceConfig::try_from_proto` added in
`datafusion/datasource/src/memory.rs` (behind the `proto` feature). The
record-batch IPC serde is pure Arrow and is inlined locally.
- The `MemoryScan` decode arm in `datafusion-proto` now delegates to
`MemorySourceConfig::try_from_proto`, and the central `MemoryScan`
encode arm in `try_from_data_source_exec` is **deleted** — proof that
the hook is the only path.
- `try_into_memory_scan_physical_plan` becomes a deprecated shim
delegating to the new hook; the now-unused `serialize_record_batches` /
`parse_record_batches` helpers are deprecated.
The wire format is byte-for-byte identical: I verified locally that a
memory scan plan (with sort information, fetch, and `show_sizes=false`)
encodes to identical bytes before and after this change, and that bytes
encoded by each version decode correctly with the other.
## Are these changes tested?
Yes. Existing roundtrip tests (`roundtrip_memory_source`,
`roundtrip_memory_source_empty_projection`) now exercise the hooks since
the central arms are gone. A new test
`roundtrip_memory_source_sort_information_and_fetch` covers
`sort_information`, `fetch`, and `show_sizes`, asserting on the decoded
`MemorySourceConfig` directly rather than only the display string.
## Are there any user-facing changes?
No behavior changes.
`PhysicalPlanNodeExt::try_into_memory_scan_physical_plan`,
`parse_record_batches`, and `serialize_record_batches` are deprecated
(still functional).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5 <[email protected]>
0 commit comments