feat(table): add RowDelta API for atomic row-level mutations#789
Open
laskoviymishka wants to merge 1 commit intoapache:mainfrom
Open
feat(table): add RowDelta API for atomic row-level mutations#789laskoviymishka wants to merge 1 commit intoapache:mainfrom
laskoviymishka wants to merge 1 commit intoapache:mainfrom
Conversation
Add Transaction.NewRowDelta() for committing data files and delete files (position or equality) in a single atomic snapshot. Includes format version validation, equality field ID validation, and full round-trip integration test.
4d67a7d to
ae8e7fb
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.
Adds
Transaction.NewRowDelta()— Go equivalent of Java'sBaseRowDelta. Commits data files and delete files (position or equality) in one atomic snapshot. This is needed for row-level mutations: an UPDATE becomes an equality delete for the old row + append of the new row, both in one commit.Resolves #602.
API
Operation type picked automatically: data-only →
append, deletes-only →delete, both →overwrite.Validation
EqualityFieldIDsreferencing existing schema columnsAddDeletes, no delete files inAddRowsKnown limitations
What's tested
The interesting ones:
added-data-files=1,added-delete-files=1, operation isoverwriteadded-equality-delete-filesshows up in summarytotal-data-filesThe round-trip integration test:
[1, 3, 5](beta and delta gone)This covers the full path: write parquet → RowDelta commit → scan with position delete filtering applied.
What's left to do
This PR covers the commit API. Remaining work for full DML support:
EntryContentEqDeletescontent type. The RowDelta API already accepts them, but there's no convenient writer yet.scanner.go:415). Needs: collect eq delete entries during scan planning, match to data files by partition + sequence number, apply hash-based anti-join during Arrow reads.validateFromSnapshot,validateNoConflictingDataFiles, etc. Java's Flink connector skips most of this for streaming, so it's not blocking for CDC use cases.