zeroshade commented on code in PR #339:
URL: https://github.com/apache/iceberg-go/pull/339#discussion_r2003586246
##########
table/metadata.go:
##########
@@ -567,14 +568,23 @@ func (b *MetadataBuilder) SetSnapshotRef(
return nil, fmt.Errorf("can't set snapshot ref %s to unknown
snapshot %d: %w", name, snapshotID, err)
}
+ isAddedSnapshot := slices.ContainsFunc(b.updates, func(u Update) bool {
+ return u.Action() == addSnapshotAction &&
u.(*addSnapshotUpdate).Snapshot.SnapshotID == snapshotID
+ })
+ if isAddedSnapshot {
+ b.lastUpdatedMS = snapshot.TimestampMs
+ }
+
if name == MainBranch {
b.updates = append(b.updates, NewSetSnapshotRefUpdate(name,
snapshotID, refType, maxRefAgeMs, maxSnapshotAgeMs, minSnapshotsToKeep))
b.currentSnapshotID = &snapshotID
+ if !isAddedSnapshot {
+ b.lastUpdatedMS = time.Now().Local().UnixMilli()
Review Comment:
I was following the pyiceberg pattern where most everything else used UTC
while in pyiceberg this uses `astimezone` to use the local one.
--
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]