Conversation
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 07:36
b13deaa to
43b936a
Compare
The column writer owns the content defined chunker and is recreated for every row group, so the chunking state is reset at each row group boundary. Writing the same table into one and into multiple row groups must give the same page boundaries apart from the row group ends.
kszucs
force-pushed
the
cdc-row-group-reset
branch
4 times, most recently
from
October 2, 2026 10:14
ed7b88a to
10d98d8
Compare
kszucs
marked this pull request as ready for review
October 2, 2026 10:31
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The changed public factory breaks ABI and disables CDC for existing direct callers.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Persists Parquet content-defined chunking state across row groups.
Changes:
- Moves chunker ownership to the file writer.
- Passes chunkers into successive column writers.
- Adds row-group boundary independence coverage.
| File | Description |
|---|---|
cpp/src/parquet/file_writer.cc |
Manages per-column chunkers. |
cpp/src/parquet/column_writer.h |
Extends the column-writer factory. |
cpp/src/parquet/column_writer.cc |
Uses externally managed chunkers. |
cpp/src/parquet/chunker_internal.h |
Updates ownership documentation. |
cpp/src/parquet/chunker_internal.cc |
Stores level metadata by value. |
cpp/src/parquet/chunker_internal_test.cc |
Tests stable page boundaries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 13:54
10d98d8 to
8d016a7
Compare
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 15:29
8d016a7 to
f556bae
Compare
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 16:35
f556bae to
0a0f214
Compare
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 16:38
0a0f214 to
0e77f38
Compare
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 16:44
0e77f38 to
f7a6240
Compare
The column writer created the chunker for every column chunk, so the chunking state was reset at each row group. The file writer now keeps one chunker per leaf column and passes it to the column writers of all the row groups.
kszucs
force-pushed
the
cdc-row-group-reset
branch
from
October 2, 2026 16:50
f7a6240 to
d5b7b42
Compare
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Rationale for this change
The content-defined chunker was owned by the column writer, which is recreated for every row group, so the chunking state was reset at each row group boundary and page boundaries depended on where a row group starts. See #51684.
What changes are included in this PR?
ColumnWriter::Make()overload.ColumnWriter::Make()now rejects such properties.NextColumn()advances the column ordinal together with the column metadata, before closing the previous column writer. Previously, if that close threw and the caller calledNextColumn()again, the ordinal fell one column behind the metadata, and the new column writer would have used the previous column's chunker.Are these changes tested?
Yes.
IndependentOfRowGroupBoundarieswrites the same table into one and into multiple row groups and expects the same page boundaries apart from the row group ends; the first commit adds it alone, failing without the fix.Are there any user-facing changes?
Files with multiple row groups get different page boundaries than before, since the chunking now continues across row groups.
ColumnWriter::Make()throws if the writer properties enable content-defined chunking; such column writers have to come from the file writer. Multi-threaded writes with content-defined chunking are about 1.7× slower until the follow-up #51692 keeps the chunker's state in registers (9.9 ms vs 5.8 ms writing 12 int32 columns of 1M rows on an Apple M4 Max, 4.4 ms with the follow-up): the chunkers are now created together, so the threads writing neighbouring columns contend for their cache lines.Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
Claude Code wrote the code, tests and description under human direction.
PR code and description written by:
Reviewed before submission by:
🤖 Generated with Claude Code