apache / apache/iceberg-python
Visitor and evaluator edge cases can over-prune files or mishandle nulls
- 主要語言
- Python
- 星號
- 1.1k
- 分支
- 588
- 平均合併
- 1 天 23 小時
- 30 天內合併 PR
- 84
描述
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.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從 _StrictMetricsEvaluator.visit_not_equal、visit_not_in 和 eval 開始,接著檢查 ResidualVisitor 上的比較方法和 visit_not_nan。執行 stats、nullable partitions 和 NotNaN 行為的現有測試;當邊界情況具有一致的語義,且沒有不安全的剪枝或 null 處理錯誤時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- data, testing-qa
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100