Let physical-plan producers reuse a CASE's first-WHEN operand as its ELSE value
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #27281 de @Weijun-H — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- backend-api-design, databases
Línea de trabajo
Start with CaseExpr and the physical expression evaluation path; the issue does not name specific files or tests, so first locate CaseExpr and its existing tests. Check how the first WHEN operand is evaluated and how an opt-in can preserve caller-specified evaluation order. Done means ELSE reuses that operand’s evaluated array for ELSE rows while retaining the original evaluation order; add coverage for reuse and ordering.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem or challenge?
CASE WHEN f(x) = 'a' THEN 'b' ELSE f(x) END evaluates f(x) for every row in the first WHEN, then again for the ELSE rows. For an expensive f the second call can dominate.
For plans that go through the logical optimizer, CommonSubexprEliminate can remove the duplicate by moving f(x) into a lower projection: with an immutable UDF f, EXPLAIN SELECT CASE WHEN f(value) = 1 THEN 100 ELSE f(value) END FROM t shows Projection: f(t.value) AS __common_expr_1 below the CASE (not extracted when f is volatile). An engine that builds physical plans directly never runs that rule. It also may not be able to use a lower projection: that evaluates f(x) before the columns preceding the CASE, so when those columns and f fail on different rows, a different error surfaces first. Spark-compatible engines need to keep the original order.
Describe the solution you'd like
An opt-in on CaseExpr: the caller states that ELSE is the same call as the operand evaluated first inside the first WHEN, and CaseExpr evaluates it once, at that position, and reuses the array for the ELSE rows. The caller supplies the evaluation-order rules, since which child a PhysicalExpr evaluates first is not part of the trait contract.
Describe alternatives you've considered
- A lower
ProjectionExecin the producer: changes which error surfaces first, as above. - Automatic detection inside
CaseExpr: needs DataFusion to know evaluation order for every expression on the path. A built-in policy forBinaryExpr/NotExpr/CastExprcould be a follow-up.
- Lenguaje dominante
- Rust
- Estrellas
- 9.6k
- Forks
- 2.6k
- Merge medio
- 3 d 4 h
- PR fusionados (30 d)
- 345
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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion#27315 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion#27094 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlPosiblemente ocupada @jonasHanhan la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion#27059 ·
Los mantenedores suelen responder en 1 día
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column statsPosiblemente ocupada @joseph-isaacs la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion#27050 ·
Los mantenedores suelen responder en 1 día
-
physical-plan: decoding an Unnest or Explain node with an unset field panicsPosiblemente ocupada @geoHeil la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/datafusion#26999 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/datafusion
Issues similares
-
area:schema documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ElectronicWave/Elemental#252 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dekobon/big-code-analysis#1887 ·
Los mantenedores suelen responder en 1 día
-
Shell中文符号输入异常Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día