Commit a0e6d49
Make LogicalPlan::Unnest expression/rebuild contracts consistent (#22783)
## Which issue does this PR close?
Closes #22769
## Rationale for this change
`LogicalPlan::Unnest` had an inconsistent API contract:
`apply_expressions()` exposed `exec_columns` but `with_new_exprs()`
rejected them via `assert_no_expressions`. This broke the standard
`node.with_new_exprs(node.expressions(), new_inputs)` pattern.
## What changes are included in this PR?
- `with_new_exprs` now accepts expressions from `apply_expressions`
(extracts `Column` values back out)
- `map_expressions` now properly transforms `exec_columns` instead of
treating Unnest as expressionless
- Removed stale comment in `extract_leaf_expressions` (semantic barrier
remains)
## Are these changes tested?
Yes — two new unit tests proving both `with_new_exprs(expressions(),
inputs)` and `with_new_exprs(vec![], inputs)` work. All existing
optimizer and SLT tests pass.
## Are there any user-facing changes?
No.
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>1 parent c7e9284 commit a0e6d49
3 files changed
Lines changed: 104 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | | - | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1190 | 1201 | | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
| 1202 | + | |
1195 | 1203 | | |
1196 | 1204 | | |
1197 | 1205 | | |
| |||
6602 | 6610 | | |
6603 | 6611 | | |
6604 | 6612 | | |
| 6613 | + | |
| 6614 | + | |
| 6615 | + | |
| 6616 | + | |
| 6617 | + | |
| 6618 | + | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
| 6622 | + | |
| 6623 | + | |
| 6624 | + | |
| 6625 | + | |
| 6626 | + | |
| 6627 | + | |
| 6628 | + | |
| 6629 | + | |
| 6630 | + | |
| 6631 | + | |
| 6632 | + | |
| 6633 | + | |
| 6634 | + | |
| 6635 | + | |
| 6636 | + | |
| 6637 | + | |
| 6638 | + | |
| 6639 | + | |
| 6640 | + | |
| 6641 | + | |
| 6642 | + | |
| 6643 | + | |
| 6644 | + | |
| 6645 | + | |
| 6646 | + | |
| 6647 | + | |
| 6648 | + | |
| 6649 | + | |
| 6650 | + | |
| 6651 | + | |
| 6652 | + | |
| 6653 | + | |
| 6654 | + | |
| 6655 | + | |
| 6656 | + | |
| 6657 | + | |
| 6658 | + | |
| 6659 | + | |
| 6660 | + | |
| 6661 | + | |
6605 | 6662 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
686 | 688 | | |
687 | 689 | | |
688 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
689 | 722 | | |
690 | 723 | | |
691 | | - | |
692 | 724 | | |
693 | 725 | | |
694 | 726 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
1154 | | - | |
1155 | 1154 | | |
1156 | 1155 | | |
1157 | 1156 | | |
| |||
3046 | 3045 | | |
3047 | 3046 | | |
3048 | 3047 | | |
3049 | | - | |
3050 | | - | |
| 3048 | + | |
| 3049 | + | |
3051 | 3050 | | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
3059 | 3057 | | |
3060 | 3058 | | |
3061 | 3059 | | |
| |||
0 commit comments