Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
3.2.1
-
None
-
None
-
Tested on pyspark 3.2.1
Description
`IN`operator in spark.sql is giving unexpected results
1 in (null, 1) => true
1 in (null, 2) = null
I would have expected the second piece of code to throw false.
>>> spark.sql('SELECT 1 in (null, 1)').show() +----------------+ |(1 IN (NULL, 1))| +----------------+ | true| +----------------+ >>> spark.sql('SELECT 1 in (null, 2)').show() +----------------+ |(1 IN (NULL, 2))| +----------------+ | null| +----------------+