zeroshade commented on code in PR #356:
URL: https://github.com/apache/iceberg-go/pull/356#discussion_r2019214042


##########
table/transaction.go:
##########
@@ -117,6 +127,101 @@ func (t *Transaction) SetProperties(props 
iceberg.Properties) error {
        return nil
 }
 
+// ReplaceFiles is actually just an overwrite operation with multiple
+// files deleted and added.
+//
+// TODO: technically, this could be a REPLACE operation but we aren't 
performing
+// any validation here that there are no changes to the underlying data. A 
REPLACE
+// operation is only valid if the data is exactly the same as the previous 
snapshot.
+//
+// For now, we'll keep using an overwrite operation.
+func (t *Transaction) ReplaceDataFiles(filesToDelete, filesToAdd []string, 
snapshotProps iceberg.Properties) error {
+       if len(filesToDelete) == 0 {
+               if len(filesToAdd) > 0 {
+                       return t.AddFiles(filesToAdd, snapshotProps, true)

Review Comment:
   good point, fixing it



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to