You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read_iceberg drops rows when a filter on a bucket, truncate or date-transform partition column is wrapped in NOT #7657
Currently, rewrite_predicate_for_partitioning (src/daft-scan/src/expr_rewriter.rs) rewrites every =, <, <=, > and >= comparison on a partition source column into a comparison on the partition value, wherever it sits in the predicate tree, including under NOT. For a lossy transform the rewritten comparison is only a superset of the matching partitions (d < '2024-03-10' becomes d_month <= 2024-03), and negating a superset gives a subset, so NOT (d < '2024-03-10') becomes d_month > 2024-03 and prunes the partition holding the matching rows. The same happens to NOT (i = 3) on bucket(i) (every other row in 3's bucket is dropped) and NOT (s = 'ab') on truncate(s, 1).
Without the partition spec, both filters return [2].
Expected behavior
[2] for both filters. A comparison under NOT should not be rewritten onto a lossy partition transform (or the predicate should be put in negation normal form first, as Iceberg's own projections do).
Component(s)
Data Sources & Sinks
Additional context
daft 0.7.26, pyiceberg 0.12.0, pyiceberg-core 0.10.1, pyarrow 25.0.1, Python 3.12.13, macOS 26.6.2, arm64 (Darwin 25.6.0). rewrite_predicate_for_partitioning has no case for Expr::Not on main.
Activity