LuciferYang opened a new pull request, #3775: URL: https://github.com/apache/iceberg-rust/pull/3775
## Which issue does this PR close? - Closes #3292. Same change as #3306, which was closed as stale, with main merged in. ## What changes are included in this PR? `Predicate::bind` rewrites `IS NULL` on a required field to `AlwaysFalse` and `IS NOT NULL` to `AlwaysTrue`, based on the field's own `required` flag. A null ancestor struct makes the field null, so binding now checks that every ancestor is required too, using a parent map that `Schema` builds once. On main both give wrong rows without an error. With `s` optional and `s.g` required, `s.g IS NULL` binds to `AlwaysFalse`, so a scan skips the rows whose `s` is null. An equality delete of a null `s.g` loads as `s.g IS NOT NULL`, binds to `AlwaysTrue`, and keeps the rows it should delete. Until #2906 lands, these predicates reach the Arrow row filter, which rejects nested leaves, so such scans fail instead. #2906 should merge after this. No public API changes. ## Are these changes tested? - `predicate`: `IS NULL` / `IS NOT NULL` on a required leaf under an optional parent, or under an optional grandparent, stay predicates; on a fully required path they still fold to `AlwaysFalse` / `AlwaysTrue`. - `schema`: `is_field_and_ancestors_required` for nested and top-level fields and an unknown id. - `test_scan_applies_null_parent_equality_delete_on_required_nested_field` stays ignored here, since it also needs #2906. On main it returns ids 1, 7, 2, 3 instead of 1, 7, 3; with this PR and #2906 it passes. ## AI Disclosure Drafted with Claude Code. Please check the new parent map stored on `Schema` and whether any other check relies on a field's own `required` flag where an ancestor can be null. -- 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]
