Commit f097f58
fix(merge): preserve metastore rg_partition_prefix_len from writer's KV stamp
The streaming merge engine produces sort-prefix-aligned multi-RG output
and stamps `qh.rg_partition_prefix_len = input_meta.rg_partition_prefix_len`
in the file's KV (verified by `assert_unique_rg_prefix_keys` before close).
`merge_parquet_split_metadata` then ran after and unconditionally demoted
to 0 whenever `output.num_row_groups > 1` — breaking CS-1 (metastore must
mirror on-disk KV) for every multi-RG streaming-engine output. Aligned
splits got tagged 0 in the metastore on every merge and leaked out of
the prefix-aligned compaction bucket on the next pass.
Carry the value the writer actually stamped via a new
`MergeOutputFile.output_rg_partition_prefix_len` field, then propagate
it as-is in metadata aggregation. Both engines populate the field:
- Legacy `merge/writer.rs` reports its demoted value (row-count-driven
RG boundaries can't honor prefix alignment, so it stamps 0 on multi-RG).
- Streaming `merge/streaming/output.rs` reports the inputs' prefix
unchanged (it splits at prefix transitions and the writer verifies).
CS-1 holds by construction — same source of truth, no re-derivation.
Tests:
- `test_output_prefix_len_demoted_when_multi_rg` → renamed to
`test_output_prefix_len_carries_writers_value_when_demoted`; now
asserts that the metastore mirrors the writer's reported value.
- New `test_output_prefix_len_preserved_on_multi_rg_streaming_engine`
asserts that a multi-RG streaming output (writer reports prefix_len=2)
keeps the prefix in the metastore — the regression case for F1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 70d4d44 commit f097f58
4 files changed
Lines changed: 92 additions & 34 deletions
File tree
- quickwit/quickwit-parquet-engine/src/merge
- streaming
Lines changed: 70 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
138 | 134 | | |
139 | 135 | | |
140 | 136 | | |
| |||
212 | 208 | | |
213 | 209 | | |
214 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
215 | 229 | | |
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
219 | 233 | | |
| 234 | + | |
220 | 235 | | |
221 | 236 | | |
222 | 237 | | |
| |||
412 | 427 | | |
413 | 428 | | |
414 | 429 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
420 | 437 | | |
421 | 438 | | |
422 | 439 | | |
423 | 440 | | |
424 | 441 | | |
425 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
426 | 445 | | |
427 | 446 | | |
428 | 447 | | |
429 | 448 | | |
430 | 449 | | |
431 | 450 | | |
432 | 451 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 452 | + | |
| 453 | + | |
437 | 454 | | |
438 | 455 | | |
439 | 456 | | |
440 | 457 | | |
441 | 458 | | |
442 | | - | |
| 459 | + | |
443 | 460 | | |
444 | 461 | | |
445 | 462 | | |
446 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
447 | 490 | | |
448 | 491 | | |
449 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 98 | + | |
105 | 99 | | |
106 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
315 | 322 | | |
316 | 323 | | |
317 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
0 commit comments