Commit 32e6fe8
authored
feat: update FFI TableProvider and ExecutionPlan to use FFI Session and TaskContext (#19281)
## Which issue does this PR close?
Addresses part of #18671 but
does not close it.
## Rationale for this change
This is the major change to address the requirements of #18671. This PR
combines all of the previous PRs in the issue and uses them in
`FFI_TableProvider` and `FFI_ExecutionPlan`. With this change the only
remaining thing to close the issue is to remove the core crate. That is
a large PR that mostly just changes import paths and will be a follow
up.
## What changes are included in this PR?
- Update all structs in the FFI crate to use the `FFI_PhysicalExpr`,
`FFI_Session`, `FFI_TaskContext`, and `FFI_LogicalExtensionCodec`.
- Remove creation of `SessionContext` within the FFI crate
- Updates unit tests
## Are these changes tested?
Unit tests are added. Coverage report:
<img width="685" height="804" alt="Screenshot 2025-12-11 at 10 42 21 AM"
src="https://github.com/user-attachments/assets/415822ec-909e-4abe-98de-ae32eb5ec9c3"
/>
## Are there any user-facing changes?
Yes.
There is one major change to using the FFI crate that downstream users
will need to implement. Now when creating a table provider, catalog
provider, etc you need to provide a `TaskContextProvider` and an
optional `LogicalExtensionCodec`. The upgrade guide has been updated.1 parent eb30c19 commit 32e6fe8
File tree
28 files changed
+874
-584
lines changed- datafusion-examples/examples/ffi
- ffi_example_table_provider/src
- ffi_module_interface/src
- ffi_module_loader
- src
- datafusion/ffi
- src
- proto
- session
- tests
- udaf
- udwf
- tests
- utils
- docs/source/library-user-guide
28 files changed
+874
-584
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | | - | |
56 | | - | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | | - | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
| |||
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | | - | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
137 | | - | |
138 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
| |||
149 | 165 | | |
150 | 166 | | |
151 | 167 | | |
152 | | - | |
| 168 | + | |
153 | 169 | | |
154 | 170 | | |
155 | | - | |
| 171 | + | |
156 | 172 | | |
157 | 173 | | |
158 | 174 | | |
159 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
160 | 182 | | |
161 | 183 | | |
162 | 184 | | |
| |||
189 | 211 | | |
190 | 212 | | |
191 | 213 | | |
| 214 | + | |
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
| |||
209 | 232 | | |
210 | 233 | | |
211 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
212 | 253 | | |
213 | 254 | | |
214 | 255 | | |
| |||
217 | 258 | | |
218 | 259 | | |
219 | 260 | | |
| 261 | + | |
220 | 262 | | |
221 | 263 | | |
222 | 264 | | |
| |||
286 | 328 | | |
287 | 329 | | |
288 | 330 | | |
289 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
290 | 336 | | |
291 | 337 | | |
292 | 338 | | |
| |||
331 | 377 | | |
332 | 378 | | |
333 | 379 | | |
| 380 | + | |
334 | 381 | | |
335 | | - | |
| 382 | + | |
| 383 | + | |
336 | 384 | | |
337 | 385 | | |
338 | 386 | | |
| |||
375 | 423 | | |
376 | 424 | | |
377 | 425 | | |
378 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
379 | 429 | | |
380 | 430 | | |
381 | 431 | | |
| |||
0 commit comments