[Spark] Use optimistic transactions for DSv2 batch writes #7826
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 174 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.309
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7826"
general
weight: 0.35
huan233usc
Changes
Create the optimistic transaction in
DeltaV2Write.toBatch()and retain it throughbatch commit. Translate executor-produced Kernel action rows through
KernelActionUtils.actionsFromKernelRow, requiring exactly one action per rowand rejecting non-
AddFileactions before committing.Keep operation-independent writer setup in
DeltaV2WriteContext, shared by batchand streaming writes. Carry catalog metadata into the batch write and populate
the append operation's mode, partition columns, and per-write
userMetadata.Full operation-metadata persistence through the Kernel commit boundary remains
unchanged.
Move the production
DeltaV2OptimisticTransactionimplementation into the V2module so the standalone batch write path can resolve it; its test suite remains
in the unified module.
Testing
Validated with Spark 4.2, Scala 2.13, and the in-tree Kernel:
sparkV2 / javafmtCheckAllsparkV2 / Test / compilespark / Test / compilespark / Compile / packageBinDeltaV2BatchWriteTest,DeltaV2StreamingWriteTest,DeltaV2WriteTest,DeltaV2WriteContextTest, andDeltaV2WriterCommitMessageTest.DeltaV2OptimisticTransactionSuiteandKernelActionUtilsSuite.All 241 executed tests passed. The transaction suite ignored 18 predeclared
unsupported V2 cases; no tests failed or were canceled.