viirya commented on code in PR #44119: URL: https://github.com/apache/spark/pull/44119#discussion_r1424908372
########## sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala: ########## @@ -4129,6 +4129,37 @@ class Dataset[T] private[sql]( new DataFrameWriterV2[T](table, this) } + /** + * Create a [[DataFrameWriterV2]] for mergeInto action. + * + * Scala Examples: + * {{{ + * spark.table("source") + * .mergeInto("target") + * .on($"source.id" === $"target.id") + * .whenMatched($"salary" === 100) + * .delete() + * .whenNotMatched() + * .insertAll() + * .whenNotMatchedBySource($"salary" === 100) + * .update(Map( + * "salary" -> lit(200) + * )) + * .merge() + * }}} + * + * @since 4.0.0 + */ + def mergeInto(table: String): DataFrameWriterV2[T] = { + // TODO: streaming could be adapted to use this interface Review Comment: Hm, does MergeInto support structured streaming? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org