[core] Gather merged aggregation rows from their inputs instead of one-row batches #1440
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 · 270 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.335
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1440"
general
weight: 0.35
JeonDaehong
Purpose
Linked issue: part of #1336, follows #1420
Aggregation reads still build a one-row
RecordBatchfor every merged key:merge_orderedslices the key columns, adds one-row metadata arrays and wraps them with the aggregator results, and the reader then interleaves those batches. #1420 removed this for partial-update.Brief change log
AggregateMergeFunctionimplementsmerge_picked. A live merged row is returned as its key row plus each aggregator's result, without building a batch. The reader gathers key columns withinterleaveas for partial-update, and concatenates each aggregated column once per output batch. Aggregated values are kept by output column so assembly stays linear in projection width.mergepath, as does the write buffer.PK table, 2M keys written 3 times,
sumandlast_non_null_value, full read, in-memory FileIO, release build. Measured in one binary withmerge_pickedswitched off by an env var, over 3 alternating rounds:sumcolumns, 100k keys written twice: 9509–9933 → 9124–9314 mssumcolumns, 500k keys written twice: 4720–4850 → 4514–4591 msWhat remains is mostly the aggregators' one-row results. Avoiding those would need the builder change discussed in #1336.
Tests
test_aggregate_picked_rows_match_materialized_rows: three overlapping runs withsumandlast_non_null_value, a key removed by DELETE underaggregation.remove-record-on-delete, an all-NULL sum, lone keys and batch size 2. It reads them once throughmerge_pickedand once through a wrapper that only hasmerge, and checks that the batches are equal and the values are as expected. Dropping the aggregator results from the picked row fails it, along with four existing aggregation tests.Ran the ci.yml steps locally (fmt, clippy, msrv, unit, rest-server, integration, datafusion, python, go).
API and Format
None.
Documentation
None.