[ https://issues.apache.org/jira/browse/SPARK-40921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-40921. --------------------------------- Fix Version/s: 3.4.0 Resolution: Fixed Issue resolved by pull request 38400 [https://github.com/apache/spark/pull/38400] > Add WHEN NOT MATCHED BY SOURCE clause to MERGE INTO command > ----------------------------------------------------------- > > Key: SPARK-40921 > URL: https://issues.apache.org/jira/browse/SPARK-40921 > Project: Spark > Issue Type: Improvement > Components: SQL > Affects Versions: 3.4.0 > Reporter: Johan Lasperas > Priority: Major > Fix For: 3.4.0 > > > The MERGE INTO syntax in Spark allows two types of WHEN clause: > * WHEN MATCHED: Specify optional condition and actions (delete or update) to > apply to rows that satisfy the merge condition. > * WHEN NOT MATCHED: Specify optional condition and actions (insert) to apply > toi rows from the source table that don't satisfy the match condition. > Other products also offer a third type of WHEN clause: > * WHEN NOT MATCHED BY SOURCE: Specify optional condition and actions (delete > or update) to apply to rows from the target table that don't satisfy the > merge condition. > See for example [T-SQL Merge > Documentation|https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-ver16] > Example: > {code:java} > MERGE INTO target > USING source > ON target.key = source.key > WHEN MATCHED THEN UPDATE SET * > WHEN NOT MATCHED THEN INSERT * > WHEN NOT MATCHED BY SOURCE THEN DELETE {code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org