feat: add delta writer for row-level changes#2219
Open
DAlperin wants to merge 1 commit intoapache:mainfrom
Open
feat: add delta writer for row-level changes#2219DAlperin wants to merge 1 commit intoapache:mainfrom
DAlperin wants to merge 1 commit intoapache:mainfrom
Conversation
This commit adds support for row-level changes (inserts, updates, and deletes) to Iceberg tables through a new DeltaWriter implementation. This enables CDC (Change Data Capture), upsert operations, and efficient row-level deletions. Key Components: 1. RowDeltaAction Transaction - New transaction type for applying row-level changes atomically - Supports both data files and delete files in a single transaction - Located in transaction/row_delta.rs 2. Position Delete Writer - Writes position delete files for efficient row-level deletions - Deletes rows by file path and row position - Located in writer/base_writer/position_delete_writer.rs 3. Delta Writer (Combined Writer) - Orchestrates data file, position delete, and equality delete writers - Intelligently routes operations based on row tracking - Memory-bounded row tracking with configurable limits - Falls back to equality deletes for older/evicted rows - Located in writer/combined_writer/delta_writer.rs Input Format: The DeltaWriter expects RecordBatch with an operations column: - Value 1 = Insert/Update (write to data file) - Value -1 = Delete (write to delete file) Memory Management: - Tracks recently written rows for efficient position deletes - Configurable max_seen_rows limit (default: 100,000) - FIFO eviction when limit is reached - Can be disabled (set to 0) to use only equality deletes
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.
Which issue does this PR close?
Closes #2218
What changes are included in this PR?
This PR adds support for row-level changes (inserts, updates, and deletes) to Iceberg tables through a new DeltaWriter implementation. This enables CDC (Change Data Capture), upsert operations, and efficient row-level deletions.
Key Components:
RowDeltaAction Transaction (could be supplanted by feat(transaction): add RowDelta transaction action for row-level modi… #2203
Position Delete Writer
Delta Writer (Combined Writer)
Input Format:
The DeltaWriter expects RecordBatch with an operations column:
Memory Management:
Are these changes tested?
Unit tests for each new writer are added.