feat(update): add OverwriteFiles for overwrite snapshot commits#741
Open
lishuxu wants to merge 1 commit into
Open
feat(update): add OverwriteFiles for overwrite snapshot commits#741lishuxu wants to merge 1 commit into
lishuxu wants to merge 1 commit into
Conversation
Summary:
Add a production OverwriteFiles builder that brings iceberg-cpp to semantic
parity with Java's BaseOverwriteFiles. It supports explicit file replacement
(DeleteFile + AddFile) and range-based replacement (OverwriteByRowFilter +
AddFile) with the same family of pre-commit concurrency validations. The
builder is a thin subclass of MergingSnapshotUpdate and reuses the existing
commit kernel (Apply/summary/retry/cleanup) unchanged.
Changes:
- New OverwriteFiles class (src/iceberg/update/overwrite_files.{h,cc}) and
Table::NewOverwrite() / Transaction::NewOverwrite() entry points.
- Builder surface: AddFile, DeleteFile, bulk DeleteFiles, OverwriteByRowFilter,
ValidateFromSnapshot, ConflictDetectionFilter, ValidateNoConflictingData,
ValidateNoConflictingDeletes, ValidateAddedFilesMatchOverwriteFilter,
WithCaseSensitivity.
- Validate(): conflict-filter resolution, concurrent add/delete conflict checks,
and strict added-file range validation (projection + StrictMetricsEvaluator).
- Tests (overwrite_files_test.cc, 45 cases) and CMake/meson wiring.
Behavior alignment with Java:
- operation() returns append/delete/overwrite from builder content.
- Conflict-filter resolution mirrors BaseOverwriteFiles (explicit -> row filter
-> AlwaysTrue); replaced-file delete checks honor ConflictDetectionFilter.
- Strict added-file validation uses a single DataSpec(), rejecting multi-spec
and empty added-file sets.
- Deviations: public WithCaseSensitivity (vs caseSensitive) to avoid a
protected-name clash; ValidateFromSnapshot rejects negative ids early.
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:
Add a production OverwriteFiles builder that brings iceberg-cpp to semantic parity with Java's BaseOverwriteFiles. It supports explicit file replacement (DeleteFile + AddFile) and range-based replacement (OverwriteByRowFilter + AddFile) with the same family of pre-commit concurrency validations. The builder is a thin subclass of MergingSnapshotUpdate and reuses the existing commit kernel (Apply/summary/retry/cleanup) unchanged.
Changes:
Behavior alignment with Java: