S3Tables / Client / create_table

create_table#

S3Tables.Client.create_table(**kwargs)#

Creates a new table associated with the given namespace in a table bucket. For more information, see Creating an Amazon S3 table in the Amazon Simple Storage Service User Guide.

Permissions

You must have the s3tables:CreateTable permission to use this operation.

Note

Additionally, you must have the s3tables:PutTableData permission to use this operation with the optional metadata request parameter.

See also: AWS API Documentation

Request Syntax

response = client.create_table(
    tableBucketARN='string',
    namespace='string',
    name='string',
    format='ICEBERG',
    metadata={
        'iceberg': {
            'schema': {
                'fields': [
                    {
                        'name': 'string',
                        'type': 'string',
                        'required': True|False
                    },
                ]
            }
        }
    }
)
Parameters:
  • tableBucketARN (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the table bucket to create the table in.

  • namespace (string) –

    [REQUIRED]

    The namespace to associated with the table.

  • name (string) –

    [REQUIRED]

    The name for the table.

  • format (string) –

    [REQUIRED]

    The format for the table.

  • metadata (dict) –

    The metadata for the table.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: iceberg.

    • iceberg (dict) –

      Contains details about the metadata of an Iceberg table.

      • schema (dict) – [REQUIRED]

        The schema for an Iceberg table.

        • fields (list) – [REQUIRED]

          The schema fields for the table

          • (dict) –

            Contains details about a schema field.

            • name (string) – [REQUIRED]

              The name of the field.

            • type (string) – [REQUIRED]

              The field type. S3 Tables supports all Apache Iceberg primitive types. For more information, see the Apache Iceberg documentation.

            • required (boolean) –

              A Boolean value that specifies whether values are required for each row in this field. By default, this is false and null values are allowed in the field. If this is true the field does not allow null values.

Return type:

dict

Returns:

Response Syntax

{
    'tableARN': 'string',
    'versionToken': 'string'
}

Response Structure

  • (dict) –

    • tableARN (string) –

      The Amazon Resource Name (ARN) of the table.

    • versionToken (string) –

      The version token of the table.

Exceptions