M-Tesla commented on code in PR #3144:
URL: https://github.com/apache/iceberg-rust/pull/3144#discussion_r3938924705
##########
crates/iceberg/src/expr/visitors/inclusive_metrics_evaluator.rs:
##########
@@ -437,28 +437,25 @@ impl BoundPredicateVisitor for
InclusiveMetricsEvaluator<'_> {
return ROWS_MIGHT_MATCH;
}
- if let Some(lower_bound) = self.lower_bound(field_id) {
- if lower_bound.is_nan() {
- // NaN indicates unreliable bounds. See the
InclusiveMetricsEvaluator docs for more.
- return ROWS_MIGHT_MATCH;
- }
+ let lower_bound = self.lower_bound(field_id);
+ let upper_bound = self.upper_bound(field_id);
- if !literals.iter().any(|datum| datum.ge(lower_bound)) {
- // if all values are less than lower bound, rows cannot match.
- return ROWS_CANNOT_MATCH;
- }
+ if lower_bound.is_some_and(|d| d.is_nan()) ||
upper_bound.is_some_and(|d| d.is_nan()) {
Review Comment:
Good call, the three `in` evaluators share that match. Pulled it into a
small crate-private helper and left bound loading / NaN handling at each
callsite.
--
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]