Commit bc9f439
feat(physical-expr-common): add list/required expr helpers to proto ctx
Expressions migrating to the `try_to_proto`/`try_from_proto` hooks (see
#21835, #22418) repeatedly hand-roll the same boilerplate the central
`datafusion-proto` match already factors out via `parse_physical_exprs`,
`parse_required_physical_expr`, and `serialize_physical_exprs`. Those
free functions can't be reused by expression authors — they take
`PhysicalProtoConverterExtension`/`PhysicalPlanDecodeContext`, which the
ctx structs deliberately hide.
Add the same shapes as thin methods on the ctx structs, built on the
existing `encode_child`/`decode` primitives:
- `PhysicalExprEncodeCtx::encode_children_expressions`
- `PhysicalExprDecodeCtx::decode_required_expression`
- `PhysicalExprDecodeCtx::decode_children_expressions`
`decode_required_expression` also standardizes the "Missing required
field" error so each expression no longer spells its own message.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1b8451c commit bc9f439
1 file changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
559 | 577 | | |
560 | 578 | | |
561 | 579 | | |
| |||
636 | 654 | | |
637 | 655 | | |
638 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
639 | 691 | | |
640 | 692 | | |
641 | 693 | | |
| |||
0 commit comments