NoahKusaba opened a new issue, #145:
URL: https://github.com/apache/datafusion-iceberg/issues/145

   ### Is your feature request related to a problem or challenge?
   
   A bare boolean column is pushed down when it is the whole filter (`WHERE b`, 
converted to `b = true`) or under `NOT` (`b = false`). As an operand of `AND` 
or `OR` it isn't:
   
   - `WHERE b AND x > 1` pushes only `x > 1`.
   - `WHERE b OR x > 1` pushes nothing, because `OR` needs both sides.
   
   Both results are correct, since DataFusion filters again, but Iceberg can't 
use `b` to skip files.
   
   There's a `TODO` for this in `convert_filter_to_predicate` 
(`crates/datafusion/src/read/predicate.rs`), added in #117.
   
   ### Describe the solution you'd like
   
   Convert a bare boolean column to `col = true` wherever `predicate` meets 
one, not only at the top level, and return it as `Converted::Exact`. `col = 
true` matches exactly the rows `col` does (a null matches neither), so it's 
also sound under `NOT`.
   
   Tests: unit tests for `b AND x > 1`, `b OR x > 1` and `NOT (b AND x > 1)`, 
and a sqllogictest that checks the rows returned.
   
   ### Additional context
   
   Part of the predicate pushdown epic.
   


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