Updates the metadata location for a specified table, typically after committing a new Iceberg metadata snapshot.
Usage notes
-
The
--version-tokenparameter enables optimistic locking. Obtain the currentversionTokenby runningget-table-metadata-location, then pass it to this parameter. If another client updates the metadata location between your read and write, the operation fails to prevent concurrent overwrites. -
--metadata-locationmust be a valid Iceberg metadata file path. -
Both
--metadata-locationand--version-tokenare required.
Command format
ossutil tables-api update-table-metadata-location --table-bucket-arn value --namespace value --name value --metadata-location value --version-token value [flags]
|
Parameter |
Type |
Description |
|
--metadata-location |
string |
Path to the new Iceberg metadata file. Required. |
|
--name |
string |
Table name. Required. |
|
--namespace |
string |
Namespace of the table. Required. |
|
--table-bucket-arn |
string |
ARN of the Table Bucket, in the format |
|
--version-token |
string |
Version token for optimistic locking. Retrieve the current token by running |
-
This command corresponds to the UpdateTableMetadataLocation API operation.
-
This command supports all ossutil Global Options.
Examples
Update the metadata location for my_table with a new metadata path and version token.
ossutil tables-api update-table-metadata-location --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --namespace my_namespace --name my_table --metadata-location oss://my-table-bucket/metadata/my_namespace/my_table/metadata/00001-abc123.metadata.json --version-token abc123def456