feat: add core COW rewrite primitive#2752
Open
u70b3 wants to merge 1 commit into
Open
Conversation
u70b3
force-pushed
the
feat/core-cow-rewrite-primitive
branch
from
July 1, 2026 01:42
e6803c1 to
d177d34
Compare
u70b3
force-pushed
the
feat/core-cow-rewrite-primitive
branch
2 times, most recently
from
July 6, 2026 10:39
88eb905 to
4f03d35
Compare
u70b3
force-pushed
the
feat/core-cow-rewrite-primitive
branch
4 times, most recently
from
July 16, 2026 05:07
dcd3474 to
db7680c
Compare
u70b3
force-pushed
the
feat/core-cow-rewrite-primitive
branch
5 times, most recently
from
July 18, 2026 01:33
1908b40 to
d2ff512
Compare
Add a core copy-on-write rewrite primitive that plans candidate data files, applies a caller-provided RecordBatch rewriter, writes replacement data files, and returns removed/added/unchanged file sets for future overwrite-style commit actions. - Plan candidates through the existing scan path so manifest pruning and delete-file application stay consistent with normal reads; the row predicate is cleared only for the full-file rewrite input. - Stream rewritten batches to the replacement writer: buffer only the prefix before the first changed batch, then open the writer lazily; unchanged files open no writer, fully-deleted files produce no replacement. - Bind the replacement writer and partition key to the planned snapshot's schema so rewrites survive schema evolution. - Build the replacement parquet writer via ParquetWriterBuilder::from_table_properties so replacement files honor the table's write.parquet.* properties. - Keep the planner internal; CowRewriteBuilder is the only public entry and CowRewriteFile fields sit behind accessors. Cover delete-style, update-style, no-op, full-file delete, no-match delete, delete-file planning, writer edge cases, schema evolution, and multi-source replacement path uniqueness. Part of apache#2269. Co-Authored-By: Claude <noreply@anthropic.com>
u70b3
force-pushed
the
feat/core-cow-rewrite-primitive
branch
from
July 22, 2026 12:02
d2ff512 to
42080dd
Compare
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.
Summary
Core Design
Related Work Map
flowchart LR Read["#2367 / #2414 / #2532<br/>delete-read improvements"] --> Scan["existing scan/read path<br/>visible rows"] Scan --> ThisPR["#2752<br/>COW rewrite primitive<br/>plan + rewrite + write files"] ThisPR --> Files["removed DataFiles<br/>added DataFiles<br/>stats"] Files --> Overwrite["#2185<br/>OverwriteAction<br/>preferred COW commit path"] Files --> RowDelta["#2203 / #2678<br/>RowDelta / MoR path"] Validator["#2590<br/>SnapshotValidator"] -. future commit validation .-> Overwrite Validator -. future commit validation .-> RowDeltaNotes
Test Plan