SAY-5 opened a new pull request, #930:
URL: https://github.com/apache/iceberg-go/pull/930

   Closes #841.
   
   \`ReplaceDataFiles\`, \`ReplaceDataFilesWithDataFiles\` and \`ReplaceFiles\` 
all produced snapshots with \`Operation = \"overwrite\"\` because of a leftover 
TODO in \`table/transaction.go\` noting that no validation enforces row-content 
equivalence. The three APIs are named \`Replace*\` for a reason: callers use 
them for compaction and delete-file GC where the row-level data is unchanged 
and only reorganized into different physical files. Per the Iceberg spec that's 
a REPLACE operation; emitting \`OVERWRITE\` masks those snapshots from 
downstream tooling that treats overwrite as a data-content change (incremental 
scans, table-maintenance logic, etc.).
   
   ## Change
   
   - \`table/transaction.go:427\` — \`ReplaceDataFiles\` now passes 
\`OpReplace\` to \`updateSnapshot\`.
   - \`table/transaction.go:736\` — \`ReplaceDataFilesWithDataFiles\` does the 
same.
   - \`table/transaction.go:849\` — \`ReplaceFiles\` does the same (this path 
also covers removing pre-existing delete files as part of a compaction rewrite).
   - \`ReplaceDataFiles\` doc comment rewritten to state the caller-held 
invariant (row content must be equivalent) explicitly instead of punting with a 
TODO.
   - \`table/replace_files_test.go\` — single assertion flipped from 
\`OpOverwrite\` to \`OpReplace\` in \`TestReplaceFiles_DataAndDeleteFiles\` to 
match the new behaviour.
   
   ## Verification
   
   \`\`\`
   $ go build ./...
   (clean)
   
   $ go test -count=1 -run 'TestReplace|TestCompact' -timeout 180s ./table/...
   ok  github.com/apache/iceberg-go/table           5.554s
   ok  github.com/apache/iceberg-go/table/compaction  6.270s
   ok  github.com/apache/iceberg-go/table/internal    3.488s
   ok  github.com/apache/iceberg-go/table/substrait   2.015s
   \`\`\`


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