iremcaginyurtturk opened a new pull request, #2001:
URL: https://github.com/apache/iceberg-go/pull/2001
## What
Adds support for creating and reading Iceberg tables in a Glue database that
is **federated to Amazon S3 Tables** (`FederatedDatabase.ConnectionType ==
aws:s3tables`) through the native Glue catalog.
## Why
Today `CreateTable` against an S3 Tables federated database fails. The
generic path resolves the table location on the client and writes metadata
there, but S3 Tables **assigns storage itself** and the federated database
exposes no location — so location resolution fails with `no default path set`
(or `NoSuchBucket` if a location is forced). Reads fail too: S3 Tables entries
report a service-specific Glue `TableType` (e.g. `customer`), which
`getRawTable` rejected.
## How
Mirrors the approach in pyiceberg's `_create_table_s3tables`:
1. Detect the federated database via `GetDatabase`.
2. Create a **minimal** Glue entry (`{format: ICEBERG}`) so S3 Tables
allocates storage.
3. `GetTable` to read the service-assigned location.
4. Write Iceberg metadata to it, then `UpdateTable` to repoint the entry.
5. Roll back (delete) the allocated entry on any later failure.
An explicit location is rejected for S3 Tables tables (storage is managed),
and a missing Glue version id is treated as a failed commit. `getRawTable` now
accepts any entry marked Iceberg via the `table_type` parameter, not only
`EXTERNAL_TABLE`, so reads/drops of S3 Tables tables work.
Non-federated (classic Glue) behavior is unchanged.
## Testing
- Unit tests: federation detection, full two-phase create, explicit-location
rejection, non-federated fallthrough, every failure/rollback path (allocate,
missing location, missing version id, metadata-write failure, update failure,
cleanup-delete failure), and the relaxed `TableType` gate.
- A gated live integration test (`TEST_S3TABLES_CATALOG_ID`,
`TEST_S3TABLES_DATABASE`) that creates and reloads a real table.
- Verified end-to-end against a live S3 Tables bucket: create → append rows
→ read back → drop.
- `go build ./...`, `go vet ./...`, `golangci-lint`, and the full `go test
./...` suite pass.
## Notes / follow-ups
- Detection issues a `GetDatabase` per create (same as pyiceberg); a missing
database is not treated as an error here so the generic path surfaces it
unchanged.
- Table creation via the `CommitTable` stage-create path is not covered for
S3 Tables (same scope as pyiceberg); happy path is `CreateTable` + append.
--
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]