You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Vishnu K Suman (Jira)" <ji...@apache.org> on 2022/04/05 16:51:00 UTC

[jira] [Updated] (SPARK-38790) Unexpected behaviour for "IN" operator in spark when null is involved in array

     [ https://issues.apache.org/jira/browse/SPARK-38790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vishnu K Suman updated SPARK-38790:
-----------------------------------
    Summary: Unexpected behaviour for "IN" operator in spark when null is involved in array  (was: Unexpected behaviour for in operator in spark when null is involved in array)

> Unexpected behaviour for "IN" operator in spark when null is involved in array
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-38790
>                 URL: https://issues.apache.org/jira/browse/SPARK-38790
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core, SQL
>    Affects Versions: 3.2.1
>         Environment: Tested on pyspark 3.2.1
>            Reporter: Vishnu K Suman
>            Priority: Major
>
> ```
> >>> 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|
> +----------------+
> ```
> 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.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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