`CoalescePartitionsExec::cardinality_effect` returns `Equal` when `fetch` is set
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia individuando CoalescePartitionsExec::cardinality_effect e i test esistenti per quell'operatore; confrontane il comportamento con SortExec e SortPreservingMergeExec quando fetch è impostato. Aggiungi o aggiorna i test per i casi con e senza fetch e conferma che gli effetti riportati sono rispettivamente LowerEqual e Equal.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
CoalescePartitionsExec::cardinality_effect always returns CardinalityEffect::Equal, which is documented as "the operator is guaranteed to produce exactly one row for each input row". When fetch is set, the operator can produce fewer rows than its input, so it should return CardinalityEffect::LowerEqual, as SortExec and SortPreservingMergeExec already do when they have a fetch.
Any code that relies on cardinality_effect gets the wrong answer for this operator. For example, PassthroughStatisticsProvider returns the input statistics unchanged for operators with CardinalityEffect::Equal, so a CoalescePartitionsExec with fetch = 10 over 1000 rows reports Exact(1000) instead of Exact(10).
To Reproduce
let plan = CoalescePartitionsExec::new(input).with_fetch(Some(10));
assert!(matches!(plan.cardinality_effect(), CardinalityEffect::LowerEqual)); // fails: Equal
Expected behavior
cardinality_effect returns CardinalityEffect::LowerEqual when fetch is set, and CardinalityEffect::Equal otherwise.
Additional context
Other readers of cardinality_effect are the physical optimizer rules sort_pushdown, topk_aggregation and limit_pushdown_past_window. I did not find a query that returns wrong results because of this, and no sqllogictest plan changes with the fix.
- Lingua principale
- Rust
- Stelle
- 9.4k
- Fork
- 2.5k
- Merge medio
- 4g 1h
- PR unite (30g)
- 376
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/datafusion
-
array_min / array_max fail on a zero-row batch for non-primitive element typesForse già presa @linuxpi l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/datafusion#26072 ·
I maintainer di solito rispondono entro 1 giorno
-
BaselineMetrics output_bytes converts every column to ArrayData for every batchForse già presa @minhh-nguyen l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/datafusion#26071 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs releaseForse già presa @isabellehuangg l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/datafusion#26030 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Lambda examples in the SQL function docs fail with the default dialectForse già presa @Prajwal-k-tech l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
apache/datafusion#25960 ·
I maintainer di solito rispondono entro 1 giorno
-
Spark `xxhash64` hashes the raw bits of a NaN instead of the canonical NaNForse già presa @mrhard9090 l’ha presa 6 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/datafusion#25913 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/datafusion
Issue simili
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcomeApertatype:debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
skaiy/wild_agentos#425 ·
I maintainer di solito rispondono entro 1 giorno
-
Default-import note suggests `import * as process` for velt:process, which does not name the builtinAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cratestack/cratestack#1154 ·
I maintainer di solito rispondono entro 1 giorno
-
status:needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agentic-os-org/ANOLISA#6742 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno