laskoviymishka commented on code in PR #2791:
URL: https://github.com/apache/iceberg-go/pull/2791#discussion_r4771094733
##########
cmd/iceberg/expire_snapshots_test.go:
##########
@@ -109,6 +109,24 @@ func TestDiffSnapshotsNoneExpired(t *testing.T) {
assert.Empty(t, expired)
}
+func TestDiffSnapshotsPreservesMillisecondPrecision(t *testing.T) {
+ // Expected values come from issue 2775 and match the iceberg snapshots
Review Comment:
Could these comments describe the behavior instead of pointing at issue 2775
and PR 2761? The same references are in the three `info_test.go` comments. The
second half ("exactly three fractional digits, including .000Z on a whole
second") already says it; the issue link belongs in the commit message.
##########
cmd/iceberg/info.go:
##########
@@ -62,7 +62,7 @@ func tableIDString(tbl *table.Table) string {
func buildTableInfo(tbl *table.Table) TableInfo {
meta := tbl.Metadata()
- lastUpdated :=
time.UnixMilli(meta.LastUpdatedMillis()).UTC().Format(time.RFC3339)
+ lastUpdated :=
time.UnixMilli(meta.LastUpdatedMillis()).UTC().Format("2006-01-02T15:04:05.000Z07:00")
Review Comment:
Should this layout be a package-level const? With this PR the literal lives
in three places: here,
[`expire_snapshots.go:152`](https://github.com/apache/iceberg-go/blob/dbc4987cea04322b2cd9480a5c4a97da087379e5/cmd/iceberg/expire_snapshots.go#L152)
and
[`snapshots.go:83`](https://github.com/apache/iceberg-go/blob/dbc4987cea04322b2cd9480a5c4a97da087379e5/cmd/iceberg/snapshots.go#L83).
One const would keep the three commands from drifting apart again.
--
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]