-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
Feature Request
Description
The AWS Glue CreateTable API supports an optional OpenTableFormatInput parameter for creating Apache Iceberg tables. This parameter is currently ignored by moto.
AWS Documentation
- CreateTable API - shows
OpenTableFormatInputas an optional parameter - OpenTableFormatInput - structure definition
Current Implementation
In moto/glue/responses.py, create_table only extracts DatabaseName and TableInput:
def create_table(self) -> str:
database_name = self.parameters.get("DatabaseName")
table_input = self.parameters.get("TableInput")
table_name = table_input.get("Name")
self.glue_backend.create_table(database_name, table_name, table_input)
return ""The OpenTableFormatInput parameter is never read from the request.
How to Reproduce
import boto3
from moto import mock_aws
@mock_aws
def test_create_iceberg_table():
client = boto3.client("glue", region_name="us-east-1")
client.create_database(DatabaseInput={"Name": "test_db"})
# OpenTableFormatInput is silently ignored
client.create_table(
DatabaseName="test_db",
TableInput={"Name": "my_table"},
OpenTableFormatInput={
"IcebergInput": {
"MetadataOperation": "CREATE",
"Version": "2"
}
}
)
# Table is created as a regular Hive table, not an Iceberg tableRelated
UpdateTablealso supportsOpenTableFormatInput(same gap inresponses.py)- The
IcebergInputstructure includes partition specs, schemas, and sort orders
Reactions are currently unavailable