Commit 50d74a7
authored
proto: add proto converter reference to PhysicalExtensionCodec trait (apache#21055)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes apache#21056
## Rationale for this change
Custom `ExecutionPlan` nodes that store `PhysicalExpr` fields cannot
participate in expression deduplication during serialization because
`PhysicalExtensionCodec::try_encode`/`try_decode` lack access to the
`PhysicalProtoConverterExtension`.
## What changes are included in this PR?
- Added `proto_converter: &dyn PhysicalProtoConverterExtension`
parameter
to `PhysicalExtensionCodec::try_decode` and `try_encode`
- Updated all implementations: `DefaultPhysicalExtensionCodec`,
`ComposedPhysicalExtensionCodec`, `ForeignPhysicalExtensionCodec` (FFI),
and all examples
- Updated call sites in `PhysicalPlanNode` serialization/deserialization
- FFI bridge passes `DefaultPhysicalProtoConverter` as a fallback
## Are these changes tested?
Yes — added `test_custom_node_with_dynamic_filter_dedup_roundtrip` which
verifies that a `DynamicFilterPhysicalExpr` shared between a
`FilterExec`
and a custom `ExecutionPlan` node preserves its shared inner state after
a
roundtrip through `DeduplicatingProtoConverter`.
## Are there any user-facing changes?
Breaking API change: `PhysicalExtensionCodec::try_decode` and
`try_encode`
now take an additional `&dyn PhysicalProtoConverterExtension` parameter.
All custom codec implementations must be updated.1 parent ad6a507 commit 50d74a7
6 files changed
Lines changed: 301 additions & 24 deletions
File tree
- datafusion-examples/examples
- custom_data_source
- proto
- datafusion
- ffi/src/proto
- proto
- src/physical_plan
- tests/cases
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
| |||
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| |||
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
| 236 | + | |
229 | 237 | | |
230 | 238 | | |
231 | 239 | | |
| |||
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
237 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
238 | 251 | | |
239 | 252 | | |
240 | 253 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | | - | |
149 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
163 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
335 | 346 | | |
336 | 347 | | |
337 | 348 | | |
| 349 | + | |
338 | 350 | | |
339 | 351 | | |
340 | 352 | | |
| |||
348 | 360 | | |
349 | 361 | | |
350 | 362 | | |
351 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
352 | 369 | | |
353 | 370 | | |
354 | 371 | | |
| |||
426 | 443 | | |
427 | 444 | | |
428 | 445 | | |
429 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
430 | 450 | | |
431 | 451 | | |
432 | 452 | | |
| |||
449 | 469 | | |
450 | 470 | | |
451 | 471 | | |
| 472 | + | |
452 | 473 | | |
453 | 474 | | |
454 | 475 | | |
| |||
467 | 488 | | |
468 | 489 | | |
469 | 490 | | |
| 491 | + | |
470 | 492 | | |
471 | 493 | | |
472 | 494 | | |
| |||
587 | 609 | | |
588 | 610 | | |
589 | 611 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
594 | 624 | | |
595 | 625 | | |
596 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
| 672 | + | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1849 | 1852 | | |
1850 | 1853 | | |
1851 | 1854 | | |
| |||
3852 | 3855 | | |
3853 | 3856 | | |
3854 | 3857 | | |
| 3858 | + | |
3855 | 3859 | | |
3856 | 3860 | | |
3857 | | - | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
3858 | 3867 | | |
3859 | 3868 | | |
3860 | 3869 | | |
| |||
3908 | 3917 | | |
3909 | 3918 | | |
3910 | 3919 | | |
| 3920 | + | |
3911 | 3921 | | |
3912 | 3922 | | |
3913 | 3923 | | |
| |||
3916 | 3926 | | |
3917 | 3927 | | |
3918 | 3928 | | |
| 3929 | + | |
3919 | 3930 | | |
3920 | 3931 | | |
3921 | 3932 | | |
| |||
4239 | 4250 | | |
4240 | 4251 | | |
4241 | 4252 | | |
| 4253 | + | |
4242 | 4254 | | |
4243 | | - | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
4244 | 4258 | | |
4245 | 4259 | | |
4246 | | - | |
4247 | | - | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
4248 | 4269 | | |
4249 | 4270 | | |
4250 | 4271 | | |
| |||
0 commit comments