You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2020/06/20 01:13:00 UTC

[jira] [Assigned] (SPARK-32030) Support unlimited MATCHED and NOT MATCHED clauses in MERGE INTO

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

Apache Spark reassigned SPARK-32030:
------------------------------------

    Assignee:     (was: Apache Spark)

> Support unlimited MATCHED and NOT MATCHED clauses in MERGE INTO
> ---------------------------------------------------------------
>
>                 Key: SPARK-32030
>                 URL: https://issues.apache.org/jira/browse/SPARK-32030
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.1
>            Reporter: Xianyin Xin
>            Priority: Major
>
> Now the {{MERGE INTO}} syntax is,
> {code:sql}
> MERGE INTO [db_name.]target_table [AS target_alias]
>  USING [db_name.]source_table [<time_travel_version>] [AS source_alias]
>  ON <merge_condition>
>  [ WHEN MATCHED [ AND <condition> ] THEN <matched_action> ]
>  [ WHEN MATCHED [ AND <condition> ] THEN <matched_action> ]
>  [ WHEN NOT MATCHED [ AND <condition> ] THEN <not_matched_action> ]{code}
> It would be nice if we support unlimited {{MATCHED}} and {{NOT MATCHED}} clauses in {{MERGE INTO}} statement, because users may want to deal with different "{{AND <condition>}}"s, the result of which just like a series of "{{CASE WHEN}}"s. The expected syntax looks like
> {code:sql}
> MERGE INTO [db_name.]target_table [AS target_alias]
>  USING [db_name.]source_table [<time_travel_version>] [AS source_alias]
>  ON <merge_condition>
>  [when_clause [, ...]]
> {code}
>  where {{when_clause}} is 
> {code:java}
> WHEN MATCHED [ AND <condition> ] THEN <matched_action>{code}
> or
> {code:java}
> WHEN NOT MATCHED [ AND <condition> ] THEN <not_matched_action>{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