You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2023/04/10 03:15:00 UTC

[jira] [Resolved] (SPARK-43053) Possible logic issue

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

Hyukjin Kwon resolved SPARK-43053.
----------------------------------
    Resolution: Invalid

> Possible logic issue
> --------------------
>
>                 Key: SPARK-43053
>                 URL: https://issues.apache.org/jira/browse/SPARK-43053
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>         Environment: Kubernetes sql operator
>            Reporter: Rob Harrison
>            Priority: Minor
>
> I found this bug when the following query returned no results:
> {code:java}
> WHERE cast(leistungsnummer as long) NOT IN (123)){code}
> However so did the following query:
> {code:java}
> WHERE cast(leistungsnummer as long) IN (123)) {code}
> This can be simplified to the following:
> {code:java}
> WHERE NULL IN (123)
> {code}
> Returns zero results but so does:
> {code:java}
> WHERE NULL NOT IN (123) {code}
> Logically one would assume `NULL IN (123, 456)` would be false.  However if that is the case then you would think `NULL NOT IN (123, 456)` would be true.  It seems they both equate to false.
> I don't know if this is a quirk of the SQL spec or if this is a bug in Spark SQL implementation but it is causing unexpected results.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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