Repository navigation
Commit b0b5471
authored
refactor: exhaustively destructure dynamic filter and scalar subquery proto hooks (apache#25178)
## Which issue does this PR close?
Closes apache#24618.
## Rationale for this change
This change makes the compiler catch fields that serialization does not
handle. When a field is added to a dynamic filter, scalar subquery
expression, or its protobuf payload, the corresponding hook must account
for it. This helps prevent new fields from being silently dropped when
expressions are encoded and decoded.
## What changes are included in this PR?
All four encoding and decoding hooks for `DynamicFilterPhysicalExpr` and
`ScalarSubqueryExpr` explicitly list every field without a rest pattern.
Dynamic filter encoding also destructures the snapshot of its shared
inner state, and decoding handles the expression ID carried by the
enclosing message.
Comments explain why caches, watch channels, cached type and nullability
checks, and subquery results are omitted, including how they are rebuilt
or supplied.
The PR also replaces one use of unstable `std::assert_matches` in an
existing execution test with `assert!(…is_ok())`, allowing the required
checks to run on the pinned stable compiler.
## What is the testing strategy for this PR?
Existing tests cover filter identity, shared updates, remapped children,
subquery metadata, nested result scopes, and execution after
serialization. The physical expression suite passed 1,739 tests with 2
ignored, and all 13 relevant protobuf integration tests passed.
The full extended workspace run passed 11,591 Rust tests, with 8
ignored, and completed all 516 SQLLogicTest files. Formatting, Clippy
with all targets and features and warnings denied, and the complete
`./dev/rust_lint.sh` suite also passed.
## Are there any user-facing changes?
No.1 parent 2cb6b54 commit b0b5471
3 files changed
Lines changed: 64 additions & 33 deletions
File tree
- datafusion
- execution/src
- physical-expr/src
- expressions/dynamic_filters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | 305 | | |
307 | 306 | | |
308 | 307 | | |
| |||
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
467 | | - | |
| 466 | + | |
468 | 467 | | |
469 | 468 | | |
470 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
611 | 620 | | |
612 | 621 | | |
613 | 622 | | |
614 | 623 | | |
615 | | - | |
| 624 | + | |
616 | 625 | | |
617 | 626 | | |
618 | 627 | | |
619 | 628 | | |
620 | 629 | | |
621 | 630 | | |
622 | 631 | | |
623 | | - | |
624 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
625 | 639 | | |
626 | 640 | | |
627 | | - | |
| 641 | + | |
628 | 642 | | |
629 | 643 | | |
630 | 644 | | |
631 | 645 | | |
632 | | - | |
| 646 | + | |
633 | 647 | | |
634 | | - | |
| 648 | + | |
635 | 649 | | |
636 | 650 | | |
637 | 651 | | |
| |||
649 | 663 | | |
650 | 664 | | |
651 | 665 | | |
| 666 | + | |
652 | 667 | | |
653 | 668 | | |
654 | | - | |
| 669 | + | |
| 670 | + | |
655 | 671 | | |
656 | 672 | | |
657 | 673 | | |
658 | 674 | | |
659 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
660 | 683 | | |
661 | 684 | | |
662 | | - | |
663 | | - | |
| 685 | + | |
664 | 686 | | |
665 | 687 | | |
666 | 688 | | |
667 | 689 | | |
668 | 690 | | |
669 | | - | |
| 691 | + | |
670 | 692 | | |
671 | 693 | | |
672 | 694 | | |
673 | | - | |
| 695 | + | |
674 | 696 | | |
675 | 697 | | |
676 | 698 | | |
677 | 699 | | |
678 | 700 | | |
679 | 701 | | |
680 | 702 | | |
681 | | - | |
| 703 | + | |
682 | 704 | | |
683 | 705 | | |
684 | 706 | | |
685 | 707 | | |
686 | 708 | | |
687 | | - | |
| 709 | + | |
688 | 710 | | |
689 | 711 | | |
690 | 712 | | |
691 | 713 | | |
692 | 714 | | |
693 | 715 | | |
694 | 716 | | |
695 | | - | |
| 717 | + | |
696 | 718 | | |
697 | | - | |
| 719 | + | |
698 | 720 | | |
699 | 721 | | |
700 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | | - | |
179 | | - | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | | - | |
| 188 | + | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
185 | | - | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
| |||
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
224 | 234 | | |
225 | 235 | | |
226 | | - | |
| 236 | + | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
230 | | - | |
| 240 | + | |
231 | 241 | | |
232 | | - | |
| 242 | + | |
233 | 243 | | |
234 | 244 | | |
235 | 245 | | |
| |||
0 commit comments