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: 

DeltaTable' object has no attribute 'clone'

RantoB
Valued Contributor

Hello, 

I use delta on my local machine and I would like to clone a table, however the cloning is not working.

I have the last version of delta installed (delta-spark==2.0.0) but the clone method does not exist in the python module.

With this code :

delta_table.clone(clone_table_name, isShallow=True, replace=True)

I have the following error :

AttributeError: 'DeltaTable' object has no attribute 'clone'

When I try this way :

spark.sql("""CREATE OR REPLACE TABLE db_2.table_name
   SHALLOW CLONE db_1.table_name""")

I have the following error

mismatched input 'SHALLOW' expecting

It looks like cloning is only available in Databricks yet. If not the case, how should I setup spark to have it working.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

jose_gonzalez
Moderator
Moderator

Hi @Bertrand BURCKER​,

Delta clone is not available in OSS yet. Right now you can only use this feature in Databricks.

You can find more details and when it will be available in this Jira https://github.com/delta-io/delta/issues/920

View solution in original post

3 REPLIES 3

-werners-
Esteemed Contributor III

It is not available in OSS delta AFAIK.

I also think it is still in public preview on Databricks, so maybe it gets added?

Anyhow, the only way to get it working is to use databricks. You can use dbx from databricks-labs if you want to develop locally.

jose_gonzalez
Moderator
Moderator

Hi @Bertrand BURCKER​,

Delta clone is not available in OSS yet. Right now you can only use this feature in Databricks.

You can find more details and when it will be available in this Jira https://github.com/delta-io/delta/issues/920

Vidula
Honored Contributor

Hello @Bertrand BURCKER​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group