ducklake icon indicating copy to clipboard operation
ducklake copied to clipboard

Feature request: table cloning

Open biellls opened this issue 6 months ago • 2 comments

Data warehouse solutions such as Snowflake and Databricks let you clone tables and evolve them separately from that point onwards. This is quite useful and, at the risk of oversimplifying, would probable be trivial to implement by someone with knowledge of the codebase since you already have snapshots and time travel.

biellls avatar Jun 05 '25 18:06 biellls

For a proof of concept, I tried implementing a clone of a DuckLake table using a batch process that directly manipulates the metadata in the __ducklake_metadata_db database. It works well and is, of course, instantaneous. However, it's just a POC and can't be used in practice, because the current logic behind commands like ducklake_expire_snapshots and ducklake_cleanup_old_files doesn't expect the same file to be used by multiple tables. Of course, I’d be happy to have this feature officially supported for a single table or a group of tables.

Mauro-Sturaro avatar Jun 06 '25 09:06 Mauro-Sturaro

is the goal to have the data lineage be more clear vs using CREATE TABLE bar AS SELECT * FROM foo? I wonder if disciplined commit messages get most of the practical benefits

dkrieger avatar Nov 20 '25 15:11 dkrieger