ducklake icon indicating copy to clipboard operation
ducklake copied to clipboard

ATTACH should verify that DATA_PATH is consistent with previous DATA_PATH

Open marhar opened this issue 6 months ago • 2 comments

Inconsistent results occur if DATA_PATH changes on ATTACH. Instead, it would be better if ATTACH reports the different paths and raises an error.

INSTALL ducklake; LOAD ducklake;
INSTALL sqlite;   LOAD sqlite;

ATTACH 'ducklake:sqlite:x3.sqlite'              AS x3 (DATA_PATH 'x3.ducklake.files/');
CREATE TABLE IF NOT EXISTS x3.t1 (a int, b int);
INSERT INTO x3.t1 VALUES (9, 10), (11, 12);
SELECT * FROM x3.t1;

DETACH x3;

-- Note that DATA_PATH is different than above.
ATTACH 'ducklake:sqlite:x3.sqlite'              AS x3 (DATA_PATH 'x3_different.ducklake.files/');
SELECT * FROM x3.t1;

Results:

...
ATTACH 'ducklake:sqlite:x3.sqlite'              AS x3 (DATA_PATH 'x3_different.ducklake.files/');
SELECT * FROM x3.t1;
IO Error:
Cannot open file "x3_different.ducklake.files/main/t1//ducklake-01977c38-0e3e-7cbc-a30c-f67c482e53af.parquet": No such file or directory

marhar avatar Jun 17 '25 04:06 marhar

This is a feature not a bug and very handy for writing using mounted storage, in my case I use blob fuse to write and abfsd to read , and works perfectly

djouallah avatar Jun 24 '25 08:06 djouallah

I think this is implemented via https://github.com/duckdb/ducklake/pull/415, could you check on duckdb 1.4.0 + relevant ducklake? Thanks!

carlopi avatar Oct 01 '25 20:10 carlopi

This should already be fixed, feel free to reopen otherwise.

pdet avatar Dec 06 '25 12:12 pdet