alliasgher opened a new pull request, #877: URL: https://github.com/apache/iceberg-go/pull/877
## Summary `ExpireSnapshots` required callers to always pass `WithRetainLast` and `WithOlderThan`; it never consulted the table-level retention properties (`min-snapshots-to-keep`, `max-snapshot-age-ms`, `max-ref-age-ms`), even though their keys and defaults are defined in `properties.go`. Tables that set these properties via a catalog would not honor them during snapshot expiry, diverging from the Java implementation. **Fix:** read the three retention properties from table metadata and use them as the last-resort fallback in the `cmp.Or` chains for `maxRefAgeMs`, `minSnapshotsToKeep`, and `maxSnapshotAgeMs`. When a property is absent the `math.MaxInt` constants apply, preserving current behaviour for callers that pass explicit options. Fixes #839 ## Test plan - [x] `go test ./...` - [x] `gofmt -l` clean - [x] New test `TestExpireSnapshotsUsesTableProperties`: creates a table with `min-snapshots-to-keep=2` and `max-snapshot-age-ms=0` set as properties, calls `ExpireSnapshots()` with no options, and asserts exactly 2 snapshots survive. Signed-off-by: Ali <[email protected]> -- 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]
