You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gengliang Wang (Jira)" <ji...@apache.org> on 2022/12/22 02:38:00 UTC

[jira] [Updated] (SPARK-41668) DECODE function returns wrong results when passed NULL

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

Gengliang Wang updated SPARK-41668:
-----------------------------------
    Affects Version/s: 3.3.1
                       3.2.2
                       3.3.0
                       3.2.1
                       3.2.0
                           (was: 3.1.2)

> DECODE function returns wrong results when passed NULL
> ------------------------------------------------------
>
>                 Key: SPARK-41668
>                 URL: https://issues.apache.org/jira/browse/SPARK-41668
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 3.2.0, 3.2.1, 3.3.0, 3.2.2, 3.3.1
>            Reporter: Serge Rielau
>            Priority: Major
>
> The DECODE function was implemented for Oracle compatibility. It works similar to CASE expression, but it is supposed to have one major difference: NULL == NULL
> [https://docs.oracle.com/database/121/SQLRF/functions057.htm#SQLRF00631]
> The Spark implementation does not observe this however:
> select decode(null, 6, 'Spark', NULL, 'SQL', 4, 'rocks');
> NULL
>  The result is supposed to be 'SQL'



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