RussellSpitzer commented on code in PR #17659:
URL: https://github.com/apache/iceberg/pull/17659#discussion_r3785833224
##########
api/src/main/java/org/apache/iceberg/expressions/InclusiveEvalVisitor.java:
##########
@@ -316,31 +315,18 @@ public <T> Boolean in(Bound<T> term, Set<T> literalSet) {
}
Comparator<T> comparator = ((BoundTerm<T>) term).comparator();
-
- literals =
- literals.stream()
- .filter(v -> comparator.compare(lower, v) <= 0)
- .collect(Collectors.toList());
- // if all values are less than lower bound, rows cannot match
- if (literals.isEmpty()) {
- return ROWS_CANNOT_MATCH;
- }
-
T upper = evalUpperBound(term);
- if (null == upper) {
- return ROWS_MIGHT_MATCH;
- }
- literals =
- literals.stream()
- .filter(v -> comparator.compare(upper, v) >= 0)
- .collect(Collectors.toList());
- // if remaining values are greater than upper bound, rows cannot match
- if (literals.isEmpty()) {
- return ROWS_CANNOT_MATCH;
+ // rows might match if any literal falls within [lower, upper]; a null
upper means no upper
+ // bound
+ for (T literal : literals) {
+ if (comparator.compare(lower, literal) <= 0
Review Comment:
why don't we have to null guard the lower bound?
--
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]