wgtmac commented on code in PR #1186:
URL: https://github.com/apache/iceberg-cpp/pull/1186#discussion_r4741207637


##########
src/iceberg/expression/strict_metrics_evaluator.cc:
##########
@@ -408,6 +417,9 @@ class StrictMetricsVisitor : public BoundVisitor<bool> {
     auto upper_it = data_file_.upper_bounds.find(id);
     if (upper_it != data_file_.upper_bounds.cend()) {
       ICEBERG_ASSIGN_OR_RAISE(auto upper, ParseBound(expr, upper_it->second));
+      if (upper.IsNaN()) {
+        return kRowsMightNotMatch;

Review Comment:
   With `lower=10`, `upper=+NaN`, and `NOT IN (1, 2)`, the lower bound alone 
proves a match, as it does in 
[Java](https://github.com/apache/iceberg/blob/d9d0b79d5d0f359ce8ba3c8c33d855ef5f8a8a99/api/src/main/java/org/apache/iceberg/expressions/StrictEvalVisitor.java#L358-L382).
 We need to treat the NaN upper bound as absent for sets without NaN literals 
while keep the conservative result when the set itself contains NaN.



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