[spark] Pin the copy-on-write scan to the snapshot it was built on #11485
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 220 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.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11485"
general
weight: 0.35
LuciferYang
Purpose
Fixes #11484. Copy-on-write DELETE, UPDATE and MERGE INTO on Spark 3.5+ run Spark's runtime group filter, which tells
PaimonCopyOnWriteScanwhich files hold matching rows. The scan then reloaded those files from the latest snapshot. If a commit such as a compaction replaced some of them in between, those files no longer matched, and the statement skipped their rows while reporting success.The scan now reads the snapshot that was latest when Spark built it, so such a commit fails with "File deletion conflicts detected", as the V1 commands do. A selected file missing from that snapshot is accepted only if a later APPEND added it, or only the other branch of a
scan.fallback-branchorscan.primary-branchtable has it. Otherwise the scan asks for a retry. Later snapshots come from the catalog when it tracks them. With options such asscan.snapshot-id, any missing file fails the statement.Tests
PaimonCopyOnWriteScanTest:scan.file-creation-time-millis, and while the catalog runs ahead of the files.scan.snapshot-id.