Commit 9773e58
authored
fix union recomputing child properties (datafusion-contrib#423)
The `ChildrenIsolatorUnionExec` when replacing children would keep the
old cached properties (things like `output_partitioning()`) rather than
recomputing them via the replaced children. This would cause stale
properties to remain.
This is evident in a scenario like this:
```text
ChildrenIsolatorUnionExec -> advertises output partitions = 2
child 0: 2 partitions
child 1: 1 partition
```
This is ok because:
```
children say: max child/task output = 2
ChildrenIsolatorUnionExec properties: output_partitioning = 2
```
But say an optimizer rule replaces child 0 with a new plan that has more
partitions:
```text
ChildrenIsolatorUnionExec -> advertises output partitions = 2 (now stale)
child 0: 8 partitions (updated)
child 1: 1 partition
```
Now `ChildrenIsolatorUntionExec is incorrect about its output.
**If `ChildrenIsolatorUntionExec` advertises too few partitions:**
```text
actual child partitions: 0 1 2 3
advertised ChildrenIsolatorUntionExec partitions: 0 1
scheduled downstream work: 0 1
missing work: 2 3
```
This can cause correctness issues if those extra partitions might never
be executed.
**If `ChildrenIsolatorUntionExec` advertises too many partitions:**
```text
actual child partitions: 0 1
advertised CIU partitions: 0 1 2 3
```
Then downstream operators might schedule extra empty work.1 parent 840ddcb commit 9773e58
2 files changed
Lines changed: 60 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
211 | 225 | | |
212 | 226 | | |
213 | 227 | | |
| |||
452 | 466 | | |
453 | 467 | | |
454 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
455 | 474 | | |
456 | 475 | | |
457 | 476 | | |
| |||
531 | 550 | | |
532 | 551 | | |
533 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
534 | 589 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| |||
0 commit comments