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