cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

CANNOT_RENAME_ACROSS_SCHEMA message error

Iam
New Contributor II

Hello...

We enabled Unity Catalog and we are migrating schemas. When I ran the command

 

sync schema catalog01.schema01 FROM hive_metastore.schema01 dry run

 

 I got the error CANNOT_RENAME_ACROSS_CATALOG, reviewing your documentation it only said 

 

 

CANNOT_RENAME_ACROSS_CATALOG
SQLSTATE: 0AKD0 
Renaming a <type> across catalogs is not allowed.

 

Could be more precise about which data type are you referring or how can I fix this issue?

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @YoSoy, The error CANNOT_RENAME_ACROSS_CATALOG occurs when you try to rename a table or schema across catalo.... This is because renaming would involve moving all the files from one location to another, which is n....

 

To resolve this issue, you can’t directly rename a table or schema across catalogs. Instead, you need to create a deep clone of the source table in the new catalog (or schema), and onc....

 

Here’s an example of how you can rename a table within the same catalog:

 

USE my_catalog.my_schema; ALTER TABLE my_table RENAME TO my_new_table;

 

This command will rename my_table to my_new_table within the same catalog and schema.

 

Please note that moving a table from one schema to another is not the same as renaming. It’s more like copying all files, which is why it’s not allowed. If you’re trying to move data from one schema to another within the same catalog, you’ll need to cre....

 

I hope this helps! Let me know if you have any other questions.

Iam
New Contributor II

Based on your answer I was able to identify the reason.

This schema was already synced to another catalog.

Thank you

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!