cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
cancel
Showing results for 
Search instead for 
Did you mean: 

CREATE TABLE SHALLOW CLONE is not supported in Unity Catalog

mohamad_atieh
New Contributor III

Hi,

I would like to clone the structure (schema only) of delta table without the content using SHALLOW CLONE command, as recommended in databricks documentation, but it doesn't work. I get an error message that this command is not supported in Unity Catalog. However, DEEP CLONE does work well.

Please find below my code and he error message:

CREATE OR REPLACE TABLE facility_silver SHALLOW CLONE facility_bronze;
 
 
Error in SQL statement: AnalysisException: [UC_COMMAND_NOT_SUPPORTED] CREATE TABLE SHALLOW CLONE is not supported in Unity Catalog.;

Anything wrong with my code?

How to clone delta table schema without its content?

Thanks,

6 REPLIES 6

Ajay-Pandey
Esteemed Contributor III

Hi @Mohamad Atieh​ I think UC doesn't not support SHALLOW CLONE yet.

Thank you for sharing your thinking. I'm for an explanation. Why it's not supported while Deep clone is supported?

I agree. I'd love to know why/when we can get shallow clone back. I WAS running a dbt slim ci setup where on pull request we'd shallow clone the schema and run state:modified+ against the clone, reporting back success/fail to the PR. Can't really do this with UC.​

RicaWage_64393
New Contributor II

I'm having the same. We use shallow clones in our development cycle, but with UC that's not possible which is a blocker

33799
New Contributor II

Can you please let us know if SHALLOW CLONE is on the roadmap for UC?

We use shallow clones to update tables and not affect running workflows...

WAHID
New Contributor II

You can shallow clone the table to an external location after sync the result of the shallow clone to unity catalog.

Here is an example https://medium.com/@wahidatoui/sync-delta-tables-stored-in-dbfs-managed-or-external-to-unity-catalog...

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.