apache / apache/iceberg-python
Visitor and evaluator edge cases can over-prune files or mishandle nulls
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 581
- Merge medio
- 1g 17h
- PR unite (30g)
- 78
Descrizione
Several visitor/evaluator edge cases appear unsafe or inconsistent:
1. `_StrictMetricsEvaluator.visit_not_equal` / `visit_not_in` return `ROWS_MUST_MATCH` when a file can contain nulls or NaNs. Example stats with `[null, 5]` or `[NaN, 5.0]` and lower/upper bounds both `5` return true for `NotEqualTo("x", 5)` / `NotIn("x", {5})`, even though one row does not match. This can incorrectly mark whole files deleted.
2. `_StrictMetricsEvaluator.eval` returns `ROWS_MUST_MATCH` for `record_count <= 0`. `record_count=0` is vacuously true, but `record_count=-1` is unknown per the local comment; even `AlwaysFalse()` returns true.
3. `ResidualVisitor` comparison methods directly compare partition values to literals. A nullable identity partition value of `None` with `LessThan("x", 1)` raises `TypeError`, while row evaluation returns false.
4. `ResidualVisitor.visit_not_nan(None)` returns `AlwaysFalse`, while expression evaluation treats `NotNaN(None)` as true. Existing tests encode both behaviors, so the semantics are inconsistent.
Validated against the current tree; examples use stats/partition shapes already supported by the repo tests.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia con _StrictMetricsEvaluator.visit_not_equal, visit_not_in ed eval, quindi esamina i metodi di confronto e visit_not_nan su ResidualVisitor. Esegui i test esistenti per stats, nullable partitions e il comportamento di NotNaN; il lavoro è completato quando i casi limite hanno una semantica coerente senza pruning non sicuro né errori nella gestione dei valori null.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100