Commit 80b8d13
shuxu.li
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 d3b02bb commit 80b8d13
13 files changed
Lines changed: 1587 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
0 commit comments