rdblue commented on a change in pull request #600: Implement in and notIn in
multiple visitors
URL: https://github.com/apache/incubator-iceberg/pull/600#discussion_r355148688
##########
File path:
api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java
##########
@@ -269,11 +270,38 @@ public Boolean or(Boolean leftResult, Boolean
rightResult) {
@Override
public <T> Boolean in(BoundReference<T> ref, Set<T> literalSet) {
+ Integer id = ref.fieldId();
+
+ if (containsNullsOnly(id)) {
+ return ROWS_CANNOT_MATCH;
+ }
+
+ final Comparator<T> comparator = ((BoundSetPredicate<T>)
expr).comparator();
Review comment:
This can't use `expr` because that is the expression being evaluated. There
is no guarantee it is a bound set predicate.
Instead, I think this should add a `comparator()` method to `BoundReference`
because it is passed into all of these methods. That has a `type()` accessor
that you can use to get the comparator, like this:
```java
Comparator<T> comparator() {
return Comparators.forType(type().asPrimitiveType());
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]