You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/05/09 09:28:16 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #41094: [SPARK-43413][SQL] Fix IN subquery ListQuery nullability

cloud-fan commented on code in PR #41094:
URL: https://github.com/apache/spark/pull/41094#discussion_r1188377181


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala:
##########
@@ -367,7 +367,7 @@ case class ListQuery(
     plan.output.head.dataType
   }
   override lazy val resolved: Boolean = childrenResolved && plan.resolved && numCols != -1
-  override def nullable: Boolean = false
+  override def nullable: Boolean = childOutputs.exists(_.nullable)

Review Comment:
   One problem is `ListQuery` can't be executed alone so its nullability is useless. We can even throw exception here to make sure no one call `def nullable`.
   
   Shall we fix `In#nullable` instead? If the list is a single-element Seq of `ListQuery`, the nullability should be defined differently.



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org