cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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!

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.