Skip to content

[Glue] Support OpenTableFormatInput for Iceberg table creation #9705

@pomykalakyle

Description

@pomykalakyle

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

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 table

Related

  • UpdateTable also supports OpenTableFormatInput (same gap in responses.py)
  • The IcebergInput structure includes partition specs, schemas, and sort orders

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions