francis0407 commented on a change in pull request #24344: [SPARK-27440][SQL] 
Optimize uncorrelated predicate subquery
URL: https://github.com/apache/spark/pull/24344#discussion_r276540110
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
 ##########
 @@ -299,7 +314,7 @@ case class ListQuery(
     childOutputs.head.dataType
   }
   override lazy val resolved: Boolean = childrenResolved && plan.resolved && 
childOutputs.nonEmpty
-  override def nullable: Boolean = false
+  override def nullable: Boolean = plan.schema.fields.exists(_.nullable)
 
 Review comment:
   `ListQuery` should be nullable, because `InSubquery`'s nullability depends 
on both left values and the subquery. If the subquery has nullable columns, 
`InSubquery` could be 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to