Changing the metadata location

From Hive, you can change the table metadata location, also known as the snapshot location.

Prerequisites

  • The new location must contain exactly the same metadata json file as the old location.

  • Before changing the metadata location, you must migrate the table to Iceberg.

After migrating a table to Iceberg, you can change the metadata location using ALTER TABLE as shown below:

Hive example

ALTER TABLE t set TBLPROPERTIES ('metadata_location'='<path>/hivemetadata/00003-a1ada2b8-fc86-4b5b-8c91-400b6b46d0f2.metadata.json');