rdblue commented on code in PR #7886:
URL: https://github.com/apache/iceberg/pull/7886#discussion_r1277797224
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkV2Filters.java:
##########
@@ -191,13 +223,17 @@ public static Expression convert(Predicate predicate) {
case IN:
if (isSupportedInPredicate(predicate)) {
- return in(
- SparkUtil.toColumnName(childAtIndex(predicate, 0)),
- Arrays.stream(predicate.children())
- .skip(1)
- .map(val -> convertLiteral(((Literal<?>) val)))
- .filter(Objects::nonNull)
- .collect(Collectors.toList()));
+ UnboundTerm<Object> term = toTerm(childAtIndex(predicate, 0));
+
+ return term != null
+ ? in(
+ term,
+ Arrays.stream(predicate.children())
+ .skip(1)
+ .map(val -> convertLiteral(((Literal<?>) val)))
+ .filter(Objects::nonNull)
Review Comment:
Yeah, looking into this more I don't think this is a bug introduced by this
PR, but a null should not be ignored. Any null value must return `null` for the
entire IN expression. Any IN or NOT IN expression with a null in the set MUST
be handled by Spark.
--
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]