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:
      PredicateValues predicateValues = predicateValues(predicate);
      handleEqual(predicateValues);
   case NOT_EQ:  
      PredicateValues predicateValues = predicateValues(predicate);
      return handleNotEqual(predicateValues);
    
   class PredicateValues {
     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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to