Commit fa453ec
refactor(ffi-example): MyExecutionPlan emits real data via
MemorySourceConfig
Was a one-column `EmptyExec` stub useful only as a capsule-handoff
target. Promoted to a minimal reference impl that a downstream Rust
crate can copy when exposing a custom `ExecutionPlan` to
datafusion-python: configurable `num_rows`, produces a single batch
of sequential `Int32` values under column `value`, wrapped in
`DataSourceExec` via `MemorySourceConfig::try_new_exec`. Header
comment explains the typical use case (remote backend, streaming
source, synthetic data generator) and the
`__datafusion_execution_plan__` capsule shape downstream crates
should follow.
Test asserts the schema-bearing plan survives the FFI hop: a
`DataSourceExec` arrives with the expected partitioning and no
children. Schema details are not surfaced through the FFI display
path (only the wrapping `ForeignExecutionPlan` name + inner plan
name appear), so the test does not assert the column name.
`to_bytes` round-trip of an FFI-imported plan is not exercised:
encoding requires a physical codec that knows how to serialize
`ForeignExecutionPlan`, which the default codec does not. A
downstream user round-tripping such a plan must install their own
codec via `with_physical_extension_codec`. Documented in the test
file rather than asserted on.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 63caf50 commit fa453ec
2 files changed
Lines changed: 76 additions & 17 deletions
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | | - | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
18 | 40 | | |
19 | 41 | | |
| 42 | + | |
20 | 43 | | |
21 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
22 | 47 | | |
23 | 48 | | |
| 49 | + | |
24 | 50 | | |
25 | 51 | | |
26 | 52 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
32 | 56 | | |
33 | 57 | | |
34 | 58 | | |
35 | 59 | | |
36 | 60 | | |
37 | 61 | | |
38 | 62 | | |
39 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
40 | 83 | | |
41 | 84 | | |
42 | 85 | | |
43 | 86 | | |
44 | | - | |
45 | | - | |
| 87 | + | |
| 88 | + | |
46 | 89 | | |
47 | 90 | | |
48 | 91 | | |
49 | 92 | | |
50 | 93 | | |
51 | 94 | | |
52 | | - | |
53 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
54 | 98 | | |
55 | 99 | | |
56 | 100 | | |
| |||
0 commit comments