Skip to content

fix(glue): Support create_table for S3 Tables federated databases#3058

Open
jamesbornholt wants to merge 1 commit intoapache:mainfrom
jamesbornholt:fix-glue-create-table-s3tables
Open

fix(glue): Support create_table for S3 Tables federated databases#3058
jamesbornholt wants to merge 1 commit intoapache:mainfrom
jamesbornholt:fix-glue-create-table-s3tables

Conversation

@jamesbornholt
Copy link

Rationale for this change

GlueCatalog.create_table() fails for S3 Tables because it tries to write Iceberg metadata to a warehouse-derived location before registering the table in Glue. S3 Tables manages storage internally, so the location is not known until the table exists in the service.

Detect S3 Tables federated databases (FederatedDatabase.ConnectionType == "aws:s3tables") and use a two-phase create: first create a minimal table entry in Glue to have S3 Tables allocate storage, then write Iceberg metadata to the managed location and update the Glue table with the metadata pointer. On failure, clean up the table entry.

This follows the same "pre-create then update" pattern used by the Java GlueCatalog when LakeFormation is enabled
(GlueTableOperations.createGlueTempTableIfNecessary).

Are these changes tested?

moto doesn't mock with enough fidelity to test this directly. I've tested locally against both S3 Tables and vanilla Glue Iceberg and confirmed CreateTable still works on both paths.

Are there any user-facing changes?

No.

GlueCatalog.create_table() fails for S3 Tables because it tries to
write Iceberg metadata to a warehouse-derived location before
registering the table in Glue. S3 Tables manages storage internally,
so the location is not known until the table exists in the service.

Detect S3 Tables federated databases (FederatedDatabase.ConnectionType
== "aws:s3tables") and use a two-phase create: first create a minimal
table entry in Glue to have S3 Tables allocate storage, then write
Iceberg metadata to the managed location and update the Glue table
with the metadata pointer. On failure, clean up the table entry.

This follows the same "pre-create then update" pattern used by the
Java GlueCatalog when LakeFormation is enabled
(GlueTableOperations.createGlueTempTableIfNecessary).
@jamesbornholt jamesbornholt force-pushed the fix-glue-create-table-s3tables branch from 5633f4e to 9708909 Compare February 17, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant