sdd commented on code in PR #347: URL: https://github.com/apache/iceberg-rust/pull/347#discussion_r1582562229
########## crates/iceberg/src/scan.rs: ########## @@ -218,6 +225,25 @@ impl TableScan { let mut manifest_entries = iter(manifest.entries().iter().filter(|e| e.is_alive())); while let Some(manifest_entry) = manifest_entries.next().await { + + // If this scan has a filter, check the data file evaluator cache for an existing + // InclusiveMetricsEvaluator that matches this manifest's partition spec ID. + // Use one from the cache if there is one. If not, create one, put it in + // the cache, and take a reference to it. + if let Some(filter) = filter.as_ref() { + #[allow(clippy::map_entry)] + if !data_file_evaluator_cache.contains_key(&entry.partition_spec_id) { Review Comment: On reflection, I think you're right. The only elements inside the `InclusiveMetricsEvaluator` struct are the filter predicate and a boolean flag, both of which can be kept as local variables outside of `try_stream`. Will update, good spot! -- 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