francis0407 commented on issue #24344: [SPARK-27440][SQL] Optimize uncorrelated 
predicate subquery
URL: https://github.com/apache/spark/pull/24344#issuecomment-486334094
 
 
   Hard to find a SQL spec :(   
   But the document I referenced 
above(https://dev.mysql.com/doc/refman/8.0/en/subquery-optimization-with-exists.html)
 explains how it behaves:
   
   > According to the SQL interpretation of NULL as “unknown value,” NULL IN 
(SELECT inner_expr ...) should evaluate to: 
   > NULL, if the SELECT produces any rows 
   > FALSE, if the SELECT produces no rows 
   
   As for the normal IN, I think it should be consistent with InSubquery. I 
have tested in Postgres(only `select null in (1);`, not sure how to express 
`select null in array()` in it), and it returns the same as InSubquery.
   

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