Skip to main content

table_metadata_locations

Creates, updates, deletes, gets or lists a table_metadata_locations resource.

Overview

Nametable_metadata_locations
TypeResource
Idaws.s3tables.table_metadata_locations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
metadata_locationstringThe metadata location.
version_tokenstringThe version token.
warehouse_locationstringThe warehouse location.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_table_metadata_locationselecttable_bucket_arn, namespace, name, regionGets the location of the table metadata. Permissions You must have the s3tables:GetTableMetadataLocation permission to use this operation.
update_table_metadata_locationupdatetable_bucket_arn, namespace, name, region, versionToken, metadataLocationUpdates the metadata location for a table. The metadata location of a table must be an S3 URI that begins with the table's warehouse location. The metadata location for an Apache Iceberg table must end with .metadata.json, or if the metadata file is Gzip-compressed, .metadata.json.gz. Permissions You must have the s3tables:UpdateTableMetadataLocation permission to use this operation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of the table.
namespacestringThe namespace of the table.
regionstringAWS region (default: us-east-1)
table_bucket_arnstringThe Amazon Resource Name (ARN) of the table bucket.

SELECT examples

Gets the location of the table metadata. Permissions You must have the s3tables:GetTableMetadataLocation permission to use this operation.

SELECT
metadata_location,
version_token,
warehouse_location
FROM aws.s3tables.table_metadata_locations
WHERE table_bucket_arn = '{{ table_bucket_arn }}' -- required
AND namespace = '{{ namespace }}' -- required
AND name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Updates the metadata location for a table. The metadata location of a table must be an S3 URI that begins with the table's warehouse location. The metadata location for an Apache Iceberg table must end with .metadata.json, or if the metadata file is Gzip-compressed, .metadata.json.gz. Permissions You must have the s3tables:UpdateTableMetadataLocation permission to use this operation.

UPDATE aws.s3tables.table_metadata_locations
SET
versionToken = '{{ versionToken }}',
metadataLocation = '{{ metadataLocation }}'
WHERE
table_bucket_arn = '{{ table_bucket_arn }}' --required
AND namespace = '{{ namespace }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND versionToken = '{{ versionToken }}' --required
AND metadataLocation = '{{ metadataLocation }}' --required
RETURNING
name,
metadata_location,
namespace,
table_arn,
version_token;