laserninja opened a new pull request, #16110:
URL: https://github.com/apache/iceberg/pull/16110

   ## Summary
   
   Handle `AlwaysFalse.INSTANCE` in `ParquetFilters.convert()` so it returns 
`FilterCompat.NOOP` instead of passing the Iceberg-internal sentinel through to 
Parquet.
   
   ## Problem
   
   Fixes #16032
   
   `ParquetFilters.convert()` had a TODO comment acknowledging that 
`AlwaysFalse.INSTANCE` was not handled. The method only guarded against 
`AlwaysTrue.INSTANCE` before calling `FilterCompat.get(pred)`. Parquet does not 
understand Iceberg's internal `AlwaysFalse` type, so the resulting filter was 
undefined — it could silently read all rows instead of none.
   
   ## Solution
   
   Added `&& pred != AlwaysFalse.INSTANCE` to the sentinel check in 
`convert()`, matching the existing `AlwaysTrue.INSTANCE` guard. When the 
expression reduces to `AlwaysFalse`, the method returns `FilterCompat.NOOP`. 
This is safe because Iceberg's own manifest-level filtering has already ensured 
no matching row groups will be scanned.
   
   ## Testing
   
   Added `TestParquetFilters` with five unit tests:
   
   - `alwaysFalseReturnsNoop` — regression guard for the exact bug
   - `alwaysTrueReturnsNoop` — confirms existing AlwaysTrue behaviour
   - `realPredicateReturnsFilter` — confirms real predicates still produce 
active filters
   - `notAlwaysFalseReturnsNoop` — `not(alwaysFalse)` resolves via the visitor
   - `andWithAlwaysFalseReturnsNoop` — `and(alwaysFalse, pred)` resolves via 
the visitor
   
   All existing `iceberg-parquet` tests pass.


-- 
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]

Reply via email to