technicolorbeat opened a new issue, #1748:
URL: https://github.com/apache/iceberg-go/issues/1748
### Proposed Change
The `loadTable` endpoint (`GET
/v1/{prefix}/namespaces/{namespace}/tables/{table}`)
accepts an optional `snapshots` query parameter that controls which
snapshots are
included in the response:
| Value | Behaviour
|
|-------------|------------------------------------------------------------------|
| _(omitted)_ | Server default — equivalent to `all`
|
| `all` | Return all currently valid snapshots
|
| `refs` | Return only snapshots referenced by a named branch or tag
|
The `refs` mode lets clients request a significantly smaller metadata
payload for
tables with long snapshot histories, since the server omits unreferenced
snapshots.
The iceberg-go REST client's `LoadTable` always omits the parameter
(defaulting to
`all`). There is currently no way for callers to opt into the lighter `refs`
response.
**Proposed changes (iceberg-go):**
- Export a `SnapshotMode` type with constants `SnapshotModeAll` and
`SnapshotModeRefs`.
- Add `LoadTableWithSnapshotMode(ctx, identifier, SnapshotMode)` on
`*rest.Catalog` that appends `?snapshots=<mode>` to the request.
- Keep `LoadTable` unchanged — it sends no query parameter (server default
applies).
**Backward compatibility:**
- `LoadTable` behaviour is unchanged; all existing callers are unaffected.
- `LoadTableWithSnapshotMode` is a purely additive method on the concrete
REST catalog type.
**Spec reference:**
REST Catalog Open API – loadTable:
https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/apache/iceberg/apache-iceberg-1.10.1/open-api/rest-catalog-open-api.yaml#tag/Catalog-API/operation/loadTable
**Willingness to contribute**
- [x] I can contribute this improvement/feature independently
- [ ] I would be willing to contribute this improvement/feature with
guidance from the Iceberg community
- [ ] I cannot contribute this improvement/feature at this time
### Proposal document
_No response_
### Specifications
- [x] Table
- [ ] View
- [x] REST
- [ ] Puffin
- [ ] Encryption
- [ ] Other
--
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]