`CoalescePartitionsExec::cardinality_effect` returns `Equal` when `fetch` is set
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza por localizar CoalescePartitionsExec::cardinality_effect y las pruebas existentes para ese operador; compara su comportamiento con SortExec y SortPreservingMergeExec cuando se establece fetch. Añade o actualiza pruebas para los casos con y sin fetch, y confirma que los efectos notificados son LowerEqual y Equal, respectivamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 9.4k
- Forks
- 2.5k
- Merge medio
- 4 d 10 h
- PR fusionados (30 d)
- 372
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/datafusion
-
array_min / array_max fail on a zero-row batch for non-primitive element typesPosiblemente ocupada @linuxpi la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/datafusion#26072 ·
Los mantenedores suelen responder en 1 día
-
BaselineMetrics output_bytes converts every column to ArrayData for every batchPosiblemente ocupada @minhh-nguyen la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion#26071 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs releasePosiblemente ocupada @isabellehuangg la tomó hace 5 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion#26030 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Lambda examples in the SQL function docs fail with the default dialectPosiblemente ocupada @Prajwal-k-tech la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
apache/datafusion#25960 ·
Los mantenedores suelen responder en 1 día
-
Spark `xxhash64` hashes the raw bits of a NaN instead of the canonical NaNPosiblemente ocupada @mrhard9090 la tomó hace 7 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/datafusion#25913 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/datafusion
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
chroma-core/chroma#7879 ·
Los mantenedores suelen responder en 1 día
-
priority middle
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
KATO-Hiro/AtCoderClans#12838 ·
Los mantenedores suelen responder en 1 día
-
clap_complete env (PowerShell): values after a space don't complete in Windows PowerShell 5.1Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día