[Spark] Add DSv2 ReplaceData write path#7051
Open
murali-db wants to merge 1 commit into
Open
Conversation
96073f9 to
3b770fb
Compare
3b770fb to
7575417
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add the copy-on-write
ReplaceDatawrite path to the Kernel-based DSv2 Spark connector, so row-level operations that rewrite touched files (e.g.UPDATE/DELETEplanned asReplaceData) can commit through the connector.ReplaceDatawrite classes:DeltaReplaceDataOperationcaptures the configuredSparkScanand exposes the scan-selectedAddFiles that need to be replaced.DeltaReplaceDataWriteBuilder/DeltaReplaceDataWriterFactory/DeltaReplaceDataWriterbuild and run the executor-side write of the replacement data files.DeltaReplaceDataBatchWritedrives the Kernel transaction on the driver: it snapshots the scan-selected files up front (socommit()andcreateBatchWriterFactory()agree on the exact same file set), writes the new data files, and commits remove-file actions for the replaced files alongside the new add-file actions.DeltaReplaceDataCommitMessagecarries the per-task writer results back to the driver for commit.ReplaceDatathroughDeltaV2WriteBuilder, capturing theSparkScanselection beforenewWriteBuilder()is invoked.PartitionUtils, reusing the existing partition /_metadataplumbing inSparkScanandDeltaV2Table.DeltaV2BatchWritepackage-private so the new write path can reuse it.How was this patch tested?
DeltaReplaceDataBatchWriteTestcovering the driver-side transaction wiring: scan-selection snapshotting, remove-file derivation from the captured scan, and commit-message aggregation.DeltaReplaceDataWriterTestcovering the executor-side writer factory and writer, including the data-file commit messages they produce.Does this PR introduce any user-facing change?
No. The DSv2 Kernel connector lives under
io.delta.spark.internal.v2; this change adds an internal write path and does not change any public API or existing behavior.