apache / apache/iceberg-python
Visitor and evaluator edge cases can over-prune files or mishandle nulls
- Vorherrschende Sprache
- Python
- Sterne
- 1.1k
- Forks
- 581
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 77
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne mit _StrictMetricsEvaluator.visit_not_equal, visit_not_in und eval und untersuche anschließend die Vergleichsmethoden und visit_not_nan auf ResidualVisitor. Führe die bestehenden Tests für stats, nullable partitions und das Verhalten von NotNaN aus; als erledigt gilt dies, wenn die Randfälle eine konsistente Semantik ohne unsicheres Pruning oder Fehler bei der Nullbehandlung aufweisen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100