Repository navigation
Commit 5be9ff5
[fix](nereids) Give all virtual columns their new ids before copying them
### What problem does this PR solve?
Issue Number: None
Related PR: apache#69399
Problem Summary:
With experimental_enable_virtual_slot_for_cse=true, a virtual column can
refer to another one, and PushDownVirtualColumnsIntoOlapScan does not list
them in dependency order, e.g. [v2 := v1 * v1, v1 := x + y]. The copier
copied the virtual columns in list order. When it copied v2, the id of v1
still mapped to itself, so the copy of v2 referred to the old v1, which the
copied scan does not output. The copier now maps every virtual column to its
new id first and then copies their expressions, which reuse those ids.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- LogicalPlanDeepCopierTest.testDeepCopyOlapScanWithDependentVirtualColumns
copies a scan whose virtual columns refer to each other, in both orders.
It fails with the previous commit, where "(v1#10002 * v1#10002) AS v2"
refers to the old v1, and passes now. LogicalPlanDeepCopierTest,
CTEInlineTest, OrExpansionTest, SplitMultiDistinctTest,
DecomposeRepeatWithPreAggregationTest, LogicalOlapScanTest,
IvmDeltaRewriteHelperTest and PushDownVirtualColumnsIntoOlapScanTest
pass. Checkstyle passes. The regression test was not run again: it
creates no virtual columns that refer to each other.
- Behavior changed: No
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent be40091 commit 5be9ff5
2 files changed
Lines changed: 24 additions & 10 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/nereids/trees/copier
- test/java/org/apache/doris/nereids/trees/copier
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 121 | + | |
127 | 122 | | |
128 | 123 | | |
129 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
| |||
0 commit comments