Amazon S3 Tables

Create a Table Bucket

To create an Amazon S3 Tables table bucket, use S3TablesCreateTableBucketOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

create_table_bucket = S3TablesCreateTableBucketOperator(
    task_id="create_table_bucket",
    table_bucket_name=bucket_name,
)

Create a Namespace

To create a namespace in an Amazon S3 Tables table bucket, use S3TablesCreateNamespaceOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

setup_namespace = S3TablesCreateNamespaceOperator(
    task_id="create_namespace",
    table_bucket_arn=create_table_bucket.output,
    namespace=namespace,
)

Create a Table

To create a new Iceberg table in an Amazon S3 Tables namespace you can use S3TablesCreateTableOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

create_table = S3TablesCreateTableOperator(
    task_id="create_table",
    table_bucket_arn=create_table_bucket.output,
    namespace=namespace,
    table_name=table_name,
    metadata=SCHEMA,
)

Delete a Namespace

To delete a namespace from an Amazon S3 Tables table bucket, use S3TablesDeleteNamespaceOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

delete_namespace = S3TablesDeleteNamespaceOperator(
    task_id="delete_namespace",
    table_bucket_arn=create_table_bucket.output,
    namespace=namespace,
    trigger_rule=TriggerRule.ALL_DONE,
)

Delete a Table

To delete a table from an Amazon S3 Tables namespace, use S3TablesDeleteTableOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

delete_table = S3TablesDeleteTableOperator(
    task_id="delete_table",
    table_bucket_arn=create_table_bucket.output,
    namespace=namespace,
    table_name=table_name,
    trigger_rule=TriggerRule.ALL_DONE,
)

Delete a Table Bucket

To delete an Amazon S3 Tables table bucket, use S3TablesDeleteTableBucketOperator.

tests/system/amazon/aws/example_s3_tables.py[source]

delete_table_bucket = S3TablesDeleteTableBucketOperator(
    task_id="delete_table_bucket",
    table_bucket_arn=create_table_bucket.output,
    trigger_rule=TriggerRule.ALL_DONE,
)

Reference

Was this entry helpful?