apache / apache/iceberg-python

Visitor and evaluator edge cases can over-prune files or mishandle nulls

未关闭
#3,498 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
1.1k
派生
581
平均合并
1 天 17 小时
30 天内合并 PR
78

描述

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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。