I have a table, located at my_catalog.my_schema.my_table
in Databricks (version 13.3 LTS) with Unity Catalog enabled.
How can I rename this table to my_catalog.my_new_schema.my_new_table
without doing a full table scan and a full copy? I want to do this as a metadata change without really going over the full data, because the table is huge.
I've tried the following:
ALTER TABLE my_catalog.my_schema.my_table RENAME TO my_catalog.my_new_schema.my_new_table
but this results in the following error:
[CANNOT_RENAME_ACROSS_SCHEMA] Renaming a table across schemas is not allowed.
It is not possible to use renaming in order to move table from one catalog (or schema) to another. That would cause moving all the files from one location to another. If you want to do that you will need to do deep clone of source table and once clone is done remove old table.
Renaming in same catalog is possible with: