Skip to content

Spark 4.2: Add insert, update, and delete write summaries to snapshot summary - #17955

Open
rahulsmahadev wants to merge 1 commit into
apache:mainfrom
rahulsmahadev:spark-4.2-dml-summaries
Open

Spark 4.2: Add insert, update, and delete write summaries to snapshot summary#17955
rahulsmahadev wants to merge 1 commit into
apache:mainfrom
rahulsmahadev:spark-4.2-dml-summaries

Conversation

@rahulsmahadev

Copy link
Copy Markdown
Contributor

Persists the row-level operation metrics that Spark 4.2 reports via the new InsertSummary, UpdateSummary, and DeleteSummary write summaries into the Iceberg snapshot summary, mirroring the existing MergeSummary support added in #15014.

Spark 4.2's WriteToDataSourceV2Exec passes an operation-specific WriteSummary to BatchWrite.commit(messages, summary) for INSERT (append), UPDATE, and DELETE. This change consumes them in Iceberg's commit path and records the following snapshot summary fields:

  • spark.insert.num-inserted-rows
  • spark.update.num-updated-rows, spark.update.num-copied-rows
  • spark.delete.num-deleted-rows, spark.delete.num-copied-rows

num-copied-rows counts unmodified rows rewritten in copy-on-write mode and is 0 in merge-on-read. The append path (BatchAppend) now forwards the InsertSummary on commit; the copy-on-write and merge-on-read row-level paths already forward their summaries.

Metric tests are added for copy-on-write and merge-on-read, and the new fields are documented in spark-writes.md.

… summary

Persist the row-level operation metrics that Spark 4.2 reports via the new InsertSummary, UpdateSummary, and DeleteSummary write summaries into the Iceberg snapshot summary, mirroring the existing MERGE support. Adds spark.insert.num-inserted-rows, spark.update.num-updated-rows / num-copied-rows, and spark.delete.num-deleted-rows / num-copied-rows, with copy-on-write and merge-on-read tests and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant