Bahtya opened a new pull request, #867:
URL: https://github.com/apache/iceberg-go/pull/867
## Summary
Fixes #841 (parent #832)
Changes `ReplaceDataFiles`, `ReplaceDataFilesWithDataFiles`, and
`ReplaceFiles` to use `OpReplace` instead of `OpOverwrite` when creating
snapshot updates.
## Problem
Per the Iceberg spec, `REPLACE` is the correct operation when data content
is equivalent but reorganized into different files (e.g., compaction). The
three replace methods were unconditionally using `OpOverwrite` despite a TODO
comment acknowledging this was incorrect.
## Changes
- `table/transaction.go`: Changed `OpOverwrite` → `OpReplace` in three
locations:
- `ReplaceDataFiles` (line ~418)
- `ReplaceDataFilesWithDataFiles` (line ~713)
- `ReplaceFiles` (line ~826)
- Removed the TODO comment at `ReplaceDataFiles` that acknowledged the
incorrect operation type
- `table/replace_files_test.go`: Updated
`TestReplaceFiles_DataAndDeleteFiles` to assert `OpReplace`
## Testing
All existing tests pass:
```
=== RUN TestReplaceFiles_DataAndDeleteFiles
--- PASS
=== RUN TestReplaceFiles_DelegatesToReplaceDataFilesWhenNoDeleteFiles
--- PASS
=== RUN TestReplaceFiles_ValidationErrors
--- PASS
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]