dhruvarya-db commented on code in PR #3144:
URL: https://github.com/apache/iceberg-rust/pull/3144#discussion_r3938853182


##########
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:
   I wonder if it is worth it to factor out this pattern into a function and 
reuse it across the three callsites?



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