cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Converting managed table to external tables

Roger667
New Contributor

I have some managed tables in catalog which i plan to convert to external tables. But i want preserve the version history of the tables as well. I have tried deep cloning but it builds the external table as version 0. Is there any way i can achieve this?

2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @Roger667,

When you use the DEEP CLONE command, you can specify the version of the table you want to clone. This allows you to create a clone of the table at a specific version, thus preserving the version history up to that point. Here is an example of how to do this:

CREATE TABLE new_external_table DEEP CLONE managed_table VERSION AS OF <version_number> LOCATION 'path_to_external_location';

ElizabethB
Databricks Employee
Databricks Employee

I'm curious to know, what is the reason why you are looking to convert from managed to external? Most customers are looking to convert from external to managed, since UC managed tables help them reduce storage costs and increase query speeds. If there's anything we can do to make managed tables better, please let us know!