`convert_filters_to_predicate` negates a weakened AND, producing a predicate that drops matching rows
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start in crates/datafusion/src/physical_plan/expr_to_predicate.rs, especially the AND handling at lines 370-382 and Expr::Not at lines 89-105. Reproduce the issue with the provided NOT (a = 1 AND upper(b) = 'X') expression, then verify that conversion returns None or only a predicate implied by the original filter.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When one side of an AND can't be converted, to_iceberg_and_predicate keeps only the other side (expr_to_predicate.rs#L370-L382). On its own that is fine for Inexact pushdown, because the result is weaker than the filter. Expr::Not then negates whatever its child produced (expr_to_predicate.rs#L89-L105). Negating a weaker predicate gives a stronger one, which rejects rows the original filter accepts.
To Reproduce
// schema: a INT, b STRING
let expr = SessionContext::new().parse_sql_expr("NOT (a = 1 AND upper(b) = 'X')", &df_schema)?;
let predicate = convert_filters_to_predicate(&[expr]);
// Some(NOT (a = 1)): drops a = 1, b = 'y', which the filter keeps
Expected behavior
The result is None, or another predicate implied by the filter. One way is to track whether each converted sub-predicate is exact, and negate only exact ones.
Additional context
SQL doesn't trigger this today with the default optimizer. DataFusion's simplifier rewrites NOT (A AND B) to NOT A OR NOT B before pushdown, so nothing is pushed for this filter. convert_filters_to_predicate is public, though, so other callers can hit it, as can any plan whose filters reach the scan without simplification. NOT (flag AND a = 1) on a boolean column has the same problem.
- Lenguaje dominante
- Rust
- Estrellas
- 30
- Forks
- 30
- Merge medio
- 3 d 19 h
- PR fusionados (30 d)
- 15
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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-iceberg
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/datafusion-iceberg#100 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
apache/datafusion-iceberg#85 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/datafusion-iceberg#84 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
apache/datafusion-iceberg#75 ·
Los mantenedores suelen responder en 1 día
-
Slow CI runnersAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
apache/datafusion-iceberg#74 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/datafusion-iceberg
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
bug order-flow studies ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
userFRM/egui-charts#2417 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
In a plain-text message, Font, Font Size, Font Color and Text Highlight Color stay livePosiblemente ocupada @ragelfundionctrumnar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
UCS-Care-Group/mailcraft#862 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
smoltcp-rs/smoltcp#1243 ·
Los mantenedores suelen responder en 1 día