table_metadata_locations
Creates, updates, deletes, gets or lists a table_metadata_locations resource.
Overview
| Name | table_metadata_locations |
| Type | Resource |
| Id | aws.s3tables.table_metadata_locations |
Fields
The following fields are returned by SELECT queries:
- get_table_metadata_location
| Name | Datatype | Description |
|---|---|---|
metadata_location | string | The metadata location. |
version_token | string | The version token. |
warehouse_location | string | The warehouse location. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_table_metadata_location | select | table_bucket_arn, namespace, name, region | Gets the location of the table metadata. Permissions You must have the s3tables:GetTableMetadataLocation permission to use this operation. | |
update_table_metadata_location | update | table_bucket_arn, namespace, name, region, versionToken, metadataLocation | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the table. |
namespace | string | The namespace of the table. |
region | string | AWS region (default: us-east-1) |
table_bucket_arn | string | The Amazon Resource Name (ARN) of the table bucket. |
SELECT examples
- get_table_metadata_location
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
- update_table_metadata_location
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;