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


##########
table/updates.go:
##########
@@ -382,7 +389,74 @@ func NewRemoveSnapshotsUpdate(ids []int64) Update {
 }
 
 func (u *removeSnapshotsUpdate) Apply(builder *MetadataBuilder) error {
-       return fmt.Errorf("%w: %s", iceberg.ErrNotImplemented, 
UpdateRemoveSnapshots)
+       _, err := builder.RemoveSnapshots(u.SnapshotIDs)
+
+       return err
+}
+
+func (u *removeSnapshotsUpdate) PostCommit(preTable *Table, postTable *Table) 
error {
+       filesToDelete := make(map[string]struct{})
+
+       for _, snap := range preTable.Metadata().Snapshots() {
+               if slices.Contains(u.SnapshotIDs, snap.SnapshotID) {
+                       filesToDelete[snap.ManifestList] = struct{}{}
+               }
+       }

Review Comment:
   We have our list of snapshotIDs, so why do we need this loop?



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