IN predicates > 200 values disable file pruning
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Start in _InclusiveMetricsEvaluationVisitor.visit_in and inspect the related use in table/update/validate.py; reproduce the 200-versus-201 benchmark described in the issue. Compare file-pruning behavior for large IN predicates and check whether the same evaluator affects conflict detection. Done means large predicates retain safe bounds-based pruning without changing the existing precise path below 200 values.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Apache Iceberg version
main (development)
Please describe the bug 🐞
While profiling the delete path from #3129, I noticed that plan_files() stops using file bounds as soon as an IN predicate contains more than 200 values.
In _InclusiveMetricsEvaluationVisitor.visit_in, we return ROWS_MIGHT_MATCH before checking the file bounds:
keys=200 planned_files=1 /20 rewritten=1
keys=201 planned_files=20 /20 rewritten=1
keys=1000 planned_files=20 /20 rewritten=1
This was on an unpartitioned table with 20 files of 10k rows each, disjoint key ranges, with all deleted keys belonging to the first file.
So the 201st value does not make the predicate significantly more expensive — it disables pruning and makes every file a candidate.
I also see the same effect when scaling the table: with the same layout, the 200 → 201 transition added about 0.15s on 5 files vs 3.60s on 80 files (median of 7 runs).
The limit comes from #1588 / #1672. The original concern was that evaluating large IN predicates could cost more than the pruning saves. However, the bounds check can potentially be reduced to a single min() / max() computation per predicate instead of scanning all literals for every file.
I would keep the current precise evaluation below the 200-value limit and only restore bounds-based pruning above it, where we currently don't prune at all.
One more thing: the same evaluator is used by conflict detection in table/update/validate.py, so this may also affect false-positive conflicts for large IN predicates.
Questions
Is disabling all pruning above 200 values intentional?
Would a min/max bounds check above the limit be acceptable?
Should the Python change be mirrored in Java?
I haven't implemented the fix yet; I'd rather confirm the intended behavior first.
Benchmark: local SQLite catalog, Python 3.10, pyarrow 25.0.1, pyiceberg 0d58407, median of 7 runs.
I used an AI assistant to help run the benchmarks and inspect the code path; the reproduction and measurements are mine.
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Lenguaje dominante
- Python
- Estrellas
- 1.1k
- Forks
- 589
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 68
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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/iceberg-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
apache/iceberg-python#4010 · 1 reacción ·
-
kind:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
apache/iceberg-python#4006 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/iceberg-python#3996 ·
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validation Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/iceberg-python#3979 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/iceberg-python#3885 ·
Todos los issues de apache/iceberg-python
Issues similares
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Abiertoarea: harness bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Human-Agent-Society/reef#625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
learningequality/kolibri#15351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Name consistency Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eellak/triplestore#65 · 1 comentario ·