zhjwpku commented on code in PR #1156:
URL: https://github.com/apache/iceberg-cpp/pull/1156#discussion_r4662640835
##########
src/iceberg/expression/inclusive_metrics_evaluator.cc:
##########
@@ -248,31 +248,19 @@ class InclusiveMetricsVisitor : public BoundVisitor<bool>
{
}
ICEBERG_ASSIGN_OR_RAISE(auto lower, LowerBound(expr));
- if (!lower.has_value() || lower->IsNull() || lower->IsNaN()) {
+ if (lower.has_value() && lower->IsNaN()) {
// NaN indicates unreliable bounds. See the InclusiveMetricsEvaluator
docs for more.
return kRowsMightMatch;
}
- auto literals_view = literal_set | std::views::filter([&](const Literal&
lit) {
- return lower.value() <= lit;
- });
- // if all values are less than lower bound, rows cannot match
- if (literals_view.empty()) {
- return kRowCannotMatch;
- }
ICEBERG_ASSIGN_OR_RAISE(auto upper, UpperBound(expr));
- if (!upper.has_value() || upper->IsNull()) {
- return kRowsMightMatch;
- }
- auto filtered_view = literals_view | std::views::filter([&](const Literal&
lit) {
- return upper.value() >= lit;
- });
- // if remaining values are greater than upper bound, rows cannot match
- if (filtered_view.empty()) {
- return kRowCannotMatch;
- }
-
- return kRowsMightMatch;
+ const bool has_lower = lower.has_value() && !lower->IsNull();
+ const bool has_upper = upper.has_value() && !upper->IsNull() &&
!upper->IsNaN();
Review Comment:
Thanks for catching this. I opened #1157 to fix the date conversion in the
shared decoder, please take a look when available.
--
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]