Hi everyone,

Currently, catalogs provide a *registerTable* function that allows
registering an existing table with a catalog if it does not already exist.
This is particularly useful for migrating Iceberg tables between catalogs.

We have users who are in the process of migrating from one catalog to
another. While migrating tables works well, migrating *views* remains
challenging. One option is to simply recreate the views, since view
creation is a lightweight operation. However, this approach has two main
drawbacks:

   -

   Recreating a view loses its version history and original metadata.
   -

   Some catalogs may not allow recreating a view if a view with the same
   name already exists in the target location.

To address this, I propose adding a *registerView* functionality for
completeness. This would enable users to register existing views with a
catalog, similar to how we register existing tables today.

As a follow-up, I can open a PR to implement:

   -

   registerView(TableIdentifier identifier, String metadataFileLocation) in
   ViewCatalog
   -

   Corresponding updates to the Iceberg REST catalog spec
   -

   Necessary API additions

Would love to hear your thoughts and feedback on this proposal.

- Ajantha

Reply via email to