Skip to content

[ADH-8380] Iceberg table rename PoC: implement metadata file rename#22

Open
tigrulya-exe wants to merge 7 commits into
develop/4.3.0/1.10.1.1from
feature/ADH-8380
Open

[ADH-8380] Iceberg table rename PoC: implement metadata file rename#22
tigrulya-exe wants to merge 7 commits into
develop/4.3.0/1.10.1.1from
feature/ADH-8380

Conversation

@tigrulya-exe

@tigrulya-exe tigrulya-exe commented Jun 4, 2026

Copy link
Copy Markdown
Member

Changes

  • New catalog flag rename.metadata.location.update (false by default), currently supported only by HMS catalog. When true, HiveCatalog also re-points the Iceberg metadata location to the new name's default warehouse path so that post-rename writes land under the new prefix.
  • The rename is performed atomically in a single HMS alter_table RPC.
  • Purging table with a drop.base-directory.enabled option now always runs the per-file purge first (behavior of drop.base-directory.enabled set to false), and only then attempts to delete the base table directory. The directory is removed only when nothing remains under the prefix, otherwise the directory is preserved. It allows a table with rename.metadata.location.update set to true survive scenarios, when another table, sitting in the previous location of the original table, is purged.
  • Added Spark tests to check the aforementioned rename, then re-create old name, then drop the new old-name with PURGE scenario.
  • Rename only re-points the metadata location, it does not physically move data files. Anything written before the rename keeps absolute paths under the old src directory and depends on that directory continuing to exist.
  • Only tables sitting at the default warehouse path are relocated, tables with an explicit LOCATION fall back to current plain rename behavior.

Limitations

  • External directory-level deletes are out of scope. A filesystem-level rm -rf, purging of another non-Iceberg Hive table sitting in the old directory, or any directory deletion that does not go through the Iceberg catalog has no protection and can cause errors, because relocated metadata file still points to the old directory.
  • RENAME_UPDATE_METADATA_LOCATION is Hive-catalog only. The flag is opt-in and implemented for HiveCatalog. Other catalogs (REST, JDBC, Glue, Nessie) are not touched in this PR.
  • Current implementation fallbacks to the old behavior (rename only table) in case if table has custom write-path properties (write.data.path, write.metadata.path, write.location-provider.impl, write.object-storage.path, write.folder-storage.path)

@tigrulya-exe tigrulya-exe changed the title Feature/adh 8380 [ADH-8380] Iceberg table rename PoC: implement metadata file rename Jun 4, 2026
@iamlapa iamlapa changed the base branch from 1.10.1-develop to develop/4.3.0/1.10.1.1 June 4, 2026 06:09
@github-actions github-actions Bot added the BUILD label Jun 4, 2026
Comment thread spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java Outdated
@github-actions github-actions Bot added the INFRA label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants