NoahKusaba opened a new issue, #151:
URL: https://github.com/apache/datafusion-iceberg/issues/151
## Goal
`read/predicate.rs` turns a query's `WHERE` filters into an Iceberg
`Predicate`, and iceberg-rust uses it to skip manifests, data files, row
groups,
pages and rows. DataFusion filters again after the scan, so a filter that
isn't
translated only costs reads. A filter that is translated wrongly, or that
iceberg-rust evaluates wrongly, skips matching rows, and they silently
disappear
from the result.
This epic tracks the work in this repo and in iceberg-rust to make pushdown
**correct first, then broader**. Dynamic (runtime) filters are tracked in
#144;
the only overlap is the shared converter below.
The rules every change must keep (now spelled out by `Converted::{Exact,
Implied}`
since #117):
1. Give up on anything that can't be translated.
2. Never produce a predicate that excludes a matching row. `AND` may drop a
side, `OR` may not, and `NOT` may only negate an `Exact` translation.
If I've missed anything, let me know and I'll update this epic.
_Last updated 2026-11-30._
## Open
### Wrong results in this repo (highest priority)
- [ ] #101 Float filters drop rows holding NaN (and maybe -0.0). DataFusion
orders NaN above every value; iceberg-rust's metrics evaluator says a
NaN-only file can't match `>`, `>=`, `=` or `IN`. Loosen float
comparisons to `… OR x IS NAN` (and `x = NaN` to `x IS NAN`), returned
as
`Implied` so `NOT` can't tighten them. Reproduce the -0.0 case first:
arrow-rs compares floats by total order, so the fix may be NaN-only.
Related upstream: apache/iceberg-rust#3353.
### Coverage in this repo
These widen what's pushed down. Each one is a new chance to break rule 2, so
each should be covered by #149.
- [ ] #145 A bare boolean column as an `AND`/`OR` operand (`b AND x > 1`).
- [ ] #146 `LIKE … ESCAPE '<c>'`.
- [ ] #73 `Decimal128` literals. The author has a draft.
- [ ] #147 Filters on struct fields (`s['a'] = 1`). Blocked on
apache/iceberg-rust#2432.
### Structure and tests in this repo
- [ ] #148 One `PhysicalExpr` → `Predicate` converter for both static and
dynamic filters, built on #106.
- [ ] #104 / #105 `IS NULL` on a struct, list or map column fails the scan
because iceberg-rust only binds predicates on primitive fields. #105
keeps
only the conjuncts that bind; it needs a rebase.
- [ ] #149 A test that compares the rows an Iceberg table returns for
generated
filters with a `MemTable` copy of the same data.
- [ ] #150 Report `Exact` pushdown so DataFusion drops the `FilterExec` above
the scan. Not ready to start: it comes after #101 and the iceberg-rust
fixes
below, and needs a decision together with #144.
### iceberg-rust: bugs that drop matching rows
All are reachable from SQL through this repo's pushdown. As discussed on
#117,
we note them inline in `predicate.rs` instead of disabling the conversion
until
they're fixed.
- [ ] apache/iceberg-rust#3482 / apache/iceberg-rust#3122 Filters on a column
promoted `int`→`long` or `float`→`double` skip older files. Manifest
pruning (apache/iceberg-rust#3483) and the row filter
(apache/iceberg-rust#3540) are fixed and in our pin. Page-index pruning
remains: apache/iceberg-rust#3521.
- [ ] apache/iceberg-rust#3626 `LIKE 'Év%'` on a `truncate[N]` partition can
skip every matching file: truncate width is counted in code points,
prefix projection in bytes. Fix: apache/iceberg-rust#3634.
- [ ] apache/iceberg-rust#3617 Filters on a Parquet `TIMESTAMP(MILLIS)`
column
drop rows when the column isn't selected. Fix:
apache/iceberg-rust#3623.
- [ ] apache/iceberg-rust#3536 The Parquet writer writes file bounds that
exclude rows when row-group string statistics are truncated, so later
filtered reads skip the file. Affects files written by `INSERT INTO`
here. Fix: apache/iceberg-rust#3537.
- [ ] apache/iceberg-rust#3565 Partition fields with names that aren't valid
Avro names (written by Java under a sanitized name) read as null, so
filtered scans skip their files. Fix: apache/iceberg-rust#3566.
### iceberg-rust: bugs that fail or panic the scan
- [ ] apache/iceberg-rust#3716 An `IN` list with a literal the reader can't
convert panics the reader thread. Fix: apache/iceberg-rust#3717.
- [ ] apache/iceberg-rust#3446 Row filters on `time` columns fail with
`FeatureUnsupported` (apache/iceberg-rust#3448 closed unmerged). Not
reachable today because `scalar_value_to_datum` doesn't convert
`Time64`
literals; blocks adding them.
- [ ] apache/iceberg-rust#2432 Row filters on nested leaf columns fail. Fix:
apache/iceberg-rust#2906. Blocks struct-field pushdown above.
### iceberg-rust: only matters once we report `Exact`
- [ ] apache/iceberg-rust#3355 The row filter keeps every row for `<` and
`<=`
on a nullable column missing from the data file. Harmless while
DataFusion re-filters. Fix: apache/iceberg-rust#3508.
- [ ] apache/iceberg-rust#3353 `Datum` equality and ordering disagree on NaN.
### iceberg-rust: performance
- [ ] apache/iceberg-rust#3739 Hash-set membership for large `IN` lists in
the
row filter (benchmarked here by #130).
- [ ] apache/iceberg-rust#3613 Skip per-row evaluation when statistics prove
every row in a row group matches.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]