szehon-ho commented on code in PR #7898:
URL: https://github.com/apache/iceberg/pull/7898#discussion_r1242595290
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkV2Filters.java:
##########
@@ -245,6 +230,57 @@ public static Expression convert(Predicate predicate) {
return null;
}
+ private static <T> UnboundPredicate<T> handleEQPredicate(Predicate
predicate) {
Review Comment:
Sorry I was probably not so clear.
Glad to see the lambda removed but I think its still not clean that there's
a repeated if/else in the common code (the predicate EQ or NOT_EQ is checked
twice, in case statement and then common method). So how about just make sure
each layer checks once.
```
case EQ:
PredicateChildren children = predicateChildren(predicate);
return handleEqual(children);
case NOT_EQ:
PredicateChildren children = predicateChildren(predicate);
return handleNotEqual(children);
class PredicateChildren {
Object value;
Column column;
}
// predicateValues returns if one side is literal and other is column, null
otherwise
// handle[Not]Equal returns null if predicateValues is null
```
--
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]