Commit 0fbe4d4
feat(update): add OverwriteFiles for overwrite snapshot commits
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.1 parent ed051a7 commit 0fbe4d4
13 files changed
Lines changed: 1587 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
0 commit comments