aokolnychyi commented on code in PR #8446:
URL: https://github.com/apache/iceberg/pull/8446#discussion_r1330594818


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkFilters.java:
##########
@@ -161,10 +162,13 @@ public static Expression convert(Filter filter) {
 
         case IN:
           In inFilter = (In) filter;
+          if (Stream.of(inFilter.values()).anyMatch(Objects::isNull)) {

Review Comment:
   Why is the previous logic wrong? 
   
   ```
   col1 IN (1, 2, NULL) -> gives true if col1 is 1
   col2 IN (1, 2, NULL) -> gives null if col1 is 10 and null means no match
   col3 IN (1, 2, NULL) -> gives null if col1 is null and null means no match
   ```
   
   Nulls in predicates are handled in a special way as they are same as false. 
   There is `ReplaceNullWithFalseInPredicate` in Spark that I worked on 4-5 
years ago.



-- 
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]

Reply via email to