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

   ### Is your feature request related to a problem or challenge?
   
   Filters reach the Iceberg scan in two forms:
   
   - `TableProvider::scan` receives logical `Expr`s. 
`crates/datafusion/src/read/predicate.rs` converts these into an Iceberg 
`Predicate`.
   - Dynamic filters (#144) only exist at execution time, as `PhysicalExpr`s. 
#106 adds a second converter, `PhysicalExpr` → `Predicate`, for these.
   
   Two converters must follow the same soundness rules: never exclude a 
matching row, `AND` may drop a side, `OR` may not, and `NOT` only negates an 
exact translation. They must also handle the same edge cases: casts (#36), 
`LIKE` escapes (#40), NaN (#101) and others. Each fix would have to land twice, 
and the two would drift.
   
   @Perseus suggested this on #117.
   
   ### Describe the solution you'd like
   
   Keep one converter, `PhysicalExpr` → `Predicate`, and convert the logical 
filters to `PhysicalExpr` during planning, as DataFusion's `ListingTable` 
already does for partition pruning 
([`helpers.rs`](https://github.com/apache/datafusion/blob/d5552342012888b7d1a3ab88d92e3d292fc0cde0/datafusion/catalog-listing/src/helpers.rs#L330-L337)).
 Then delete the `Expr` converter.
   
   Things to settle:
   
   - It has to work with both eager planning (files are listed in 
`TableProvider::scan`, using the filters) and lazy planning.
   - The tests in `predicate.rs` move to the physical converter unchanged, so 
the move can be checked to give the same predicates.
   - Order with #106: land #106 first and then remove the logical converter, or 
have #106 replace it directly.
   
   ### Additional context
   
   Part of the predicate pushdown epic. Related: #144, #106, #68.
   


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