Bahtya commented on PR #867:
URL: https://github.com/apache/iceberg-go/pull/867#issuecomment-4266165274

   Hi @zeroshade, thanks for the review! I've updated the PR to validate data 
changes before using OpReplace in all three replace methods:
   
   1. **ReplaceDataFiles**: Compares total record count of deleted files vs 
added files. Uses OpOverwrite when counts differ.
   2. **ReplaceDataFilesWithDataFiles**: Same validation pattern.
   3. **ReplaceFiles**: Accounts for removed delete file records: uses 
OpOverwrite when (deletedCount - removedDeleteCount) != addedCount.
   
   The key insight: OpReplace is now only used when record counts match 
(metadata-only reorganization like compaction), and OpOverwrite is used when 
actual data content has changed. This aligns with the Iceberg spec where 
REPLACE is for operations that don't change data content.


-- 
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]

Reply via email to