[core] Read single-run primary-key sections without sort merge #1164
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 267 lines diff across 3 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.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1164"
general
weight: 0.35
JeonDaehong
Purpose
Linked issue: close #1163
Brief change log
KeyValueFileReader::readskips the sort merge for a section with one sorted run under the deduplicate or first-row engine. A run should hold one version per key, but files written before #839 can repeat a key whatever engine the schemas name, so the unmerged path holds one batch back and compares adjacent keys; at the first repeated key it hands the held batch and the rest of the run to the sort merge. Each batch still drops retract rows the way the merge handles a lone version, and first-row withoutignore-deleterejects them. That's needed because older Rust writers recordeddelete_row_count = 0for files holding DELETE rows.read_with_merge_function(audit log) always merges. Other sections merge as before.Four disjoint level-0 files in one split, 2M rows: 102 ms → 18 ms on current main (4 rounds alternating on one instance, ranges don't overlap). Overlapping sections take the merge path unchanged.
Tests
pk_single_run_read_test: three disjoint files in one split read back once each, with a value-only projection and a residual filter; overlapping one of them still merges to the newer value.single_run_read_drops_retracts_hidden_by_legacy_metadata: a two-file run whose second file holds a DELETE withdelete_row_count = 0reads[1, 2]under deduplicate and first-row withignore-delete, and errors under first-row.single_run_read_merges_*: a deduplicate-schema file that repeats a key, files written under aggregation and then ALTERed, the same files read through time travel and dynamic options, and a key repeated across one-row batches after earlier rows went out. All fail with the repeated-key check turned off.dv_merge_on_read_loads_deletion_vectors_per_fileasserted the first batch had 128 rows, the merge's output size. Its delete-free files now stream unmerged, so it checks the batch is non-empty; the lazy DV loading it covers is unchanged.Ran the ci.yml steps locally (fmt, clippy, msrv, unit, rest-server, integration, datafusion, python, go).
API and Format
None.
Documentation
None.