[ https://issues.apache.org/jira/browse/SPARK-32030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17140908#comment-17140908 ]
Apache Spark commented on SPARK-32030: -------------------------------------- User 'xianyinxin' has created a pull request for this issue: https://github.com/apache/spark/pull/28875 > 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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org