FANNG1 commented on code in PR #588: URL: https://github.com/apache/iceberg-rust/pull/588#discussion_r1740096447
########## crates/integrations/datafusion/src/physical_plan/scan.rs: ########## @@ -138,3 +147,223 @@ async fn get_batch_stream( Ok(Box::pin(stream)) } + +/// Converts DataFusion filters ([`Expr`]) to an iceberg [`Predicate`]. +/// If none of the filters could be converted, return `None` which adds no predicates to the scan operation. +/// If the conversion was successful, return the converted predicates combined with an AND operator. +fn convert_filters_to_predicate(filters: &[Expr]) -> Option<Predicate> { + PredicateConverter.visit_many(filters) +} + +#[cfg(test)] +mod tests { Review Comment: It seems there are too many tests which make it hard to review and maintain. may be we could classify it as: 1. whether a simple expression (without `and` `or` expression) could be converted to a predication. 1 test for the cases for yes, 1 test for the cases for no. 2. a combination of `AND`, `OR`, convertible Expr, un-convertible Expr test cases. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org