[ 
https://issues.apache.org/jira/browse/SPARK-42223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17681540#comment-17681540
 ] 

Apache Spark commented on SPARK-42223:
--------------------------------------

User 'wankunde' has created a pull request for this issue:
https://github.com/apache/spark/pull/39780

> Remove duplicate branches in CASE_WHEN and COALESCE function
> ------------------------------------------------------------
>
>                 Key: SPARK-42223
>                 URL: https://issues.apache.org/jira/browse/SPARK-42223
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Wan Kun
>            Priority: Minor
>
> We can remove the duplicate branches in CASE_WHEN and COALESCE function.
> For example:
> {code:sql}
> SELECT
>   CASE WHEN id = 200 THEN 1
>        WHEN id = 200 THEN 2 -- same condition, can remove
>        WHEN id = 200 THEN 3 -- same condition, can remove
>        ELSE 0 END as c1,
>   coalesce(
>     id + 1,
>     id + 1, -- same expression, can remove
>     id) as c2
> FROM t1
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to