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

[jira] [Updated] (SPARK-30705) Improve CaseWhen sub-expression equality

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

Yuming Wang updated SPARK-30705:
--------------------------------
    Description: 
We only support the first condition expression. But we can improve this pattern:
{code:sql}
CASE WHEN testUdf(a) > 3 THEN 4
WHEN testUdf(a) = 3 THEN 3
WHEN testUdf(a) = 2 THEN 2
WHEN testUdf(a) = 1 THEN 1
ELSE 0 END
{code}

  was:
We only support the first condition expression. We can improve this pattern:
{code:sql}
CASE WHEN testUdf(a) > 3 THEN 4
WHEN testUdf(a) = 3 THEN 3
WHEN testUdf(a) = 2 THEN 2
WHEN testUdf(a) = 1 THEN 1
ELSE 0 END
{code}


> Improve CaseWhen sub-expression equality
> ----------------------------------------
>
>                 Key: SPARK-30705
>                 URL: https://issues.apache.org/jira/browse/SPARK-30705
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> We only support the first condition expression. But we can improve this pattern:
> {code:sql}
> CASE WHEN testUdf(a) > 3 THEN 4
> WHEN testUdf(a) = 3 THEN 3
> WHEN testUdf(a) = 2 THEN 2
> WHEN testUdf(a) = 1 THEN 1
> ELSE 0 END
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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