Commit 7fa6378
## Which issue does this PR close?
- Related to #17261
## Rationale for this change
Each time a LogicalPlan is rewritten to eliminate a Union, we traverse
the entire plan tree and copy some non trivial parts of it
Thus it is faster to plan when we have fewer passes over the plan tree
the EliminateNestedUnion and EliminateOneUnion rules both do similar
things, and
the EliminateNestedUnion rule is very simple. So let's combine them into
a
single rule that does both things in one pass over the plan tree.
## What changes are included in this PR?
Consolidate `EliminateNestedUnion` and `EliminateOneUnion` optimizer
rules into a single pass
## Are these changes tested?
Yes with existing tests
I will also run planning benchmarks
## Are there any user-facing changes?
No
---------
Co-authored-by: Jeffrey Vo <[email protected]>
1 parent b05d811 commit 7fa6378
File tree
7 files changed
+53
-147
lines changed- datafusion
- optimizer/src
- proto/tests/cases
- sqllogictest/test_files
7 files changed
+53
-147
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
423 | 452 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | | - | |
| 230 | + | |
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
| |||
241 | 240 | | |
242 | 241 | | |
243 | 242 | | |
244 | | - | |
245 | | - | |
246 | 243 | | |
247 | 244 | | |
248 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
2744 | 2744 | | |
2745 | 2745 | | |
2746 | 2746 | | |
2747 | | - | |
| 2747 | + | |
2748 | 2748 | | |
2749 | 2749 | | |
2750 | 2750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
| |||
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
201 | | - | |
| 200 | + | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
| |||
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | | - | |
215 | 213 | | |
216 | 214 | | |
217 | 215 | | |
| |||
537 | 535 | | |
538 | 536 | | |
539 | 537 | | |
540 | | - | |
| 538 | + | |
541 | 539 | | |
542 | 540 | | |
543 | 541 | | |
| |||
550 | 548 | | |
551 | 549 | | |
552 | 550 | | |
553 | | - | |
554 | 551 | | |
555 | 552 | | |
556 | 553 | | |
| |||
559 | 556 | | |
560 | 557 | | |
561 | 558 | | |
562 | | - | |
| 559 | + | |
563 | 560 | | |
564 | 561 | | |
565 | 562 | | |
| |||
572 | 569 | | |
573 | 570 | | |
574 | 571 | | |
575 | | - | |
576 | 572 | | |
577 | 573 | | |
578 | 574 | | |
| |||
0 commit comments