Repository navigation
Commit 3310fd5
authored
## Which issue does this PR close?
- Closes #26050.
## Rationale for this change
`CoalescePartitionsExec::cardinality_effect` returns
`CardinalityEffect::Equal` even when `fetch` is set, although the
operator can then produce fewer rows than its input. Code that relies on
`cardinality_effect` gets the wrong answer, for example
`PassthroughStatisticsProvider` reports the input row count and drops
the fetch.
## What changes are included in this PR?
- `CoalescePartitionsExec::cardinality_effect` returns
`CardinalityEffect::LowerEqual` when `fetch` is set, as `SortExec` and
`SortPreservingMergeExec` already do.
## What is the testing strategy for this PR?
- New unit test for `cardinality_effect` with and without `fetch`.
- New unit test showing that `PassthroughStatisticsProvider` no longer
drops the fetch (`Exact(10)` instead of `Exact(1000)`).
- `sqllogictest` and the core `physical_optimizer` integration tests
pass with no plan changes.
## Are there any user-facing changes?
No.
----
Disclaimer: I used AI to assist in the code generation, I have manually
reviewed the output and it matches my intention and understanding.
1 parent 7833125 commit 3310fd5
2 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| |||
698 | 702 | | |
699 | 703 | | |
700 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
701 | 722 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1986 | 1986 | | |
1987 | 1987 | | |
1988 | 1988 | | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
1989 | 2005 | | |
1990 | 2006 | | |
1991 | 2007 | | |
| |||
0 commit comments