You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just learned about the MATCHED BY SOURCE directive which is pretty cool and very helpful when one would want to delete missing records.
Following example works perfectly in plain DuckDB:
CREATETABLEmy_table (
ts TIMESTAMP,
id BIGINT,
another BIGINT
);
CREATETABLEmy_table_newASFROM my_table LIMIT0;
insert into my_table VALUES
('2025-09-14', 41, 39),
('2025-09-15', 43, 39),
('2025-09-16', 44, 40);
insert into my_table_new VALUES
('2025-09-14', 41, 39),
('2025-09-15', 43, 20),
('2025-09-17', 45, 20);
MERGE INTO my_table
USING my_table_new
USING(id)
WHEN MATCHED THEN UPDATE
WHEN NOT MATCHED BY SOURCE THEN DELETE
WHEN NOT MATCHED THEN INSERT;
But when I try to use it inside a Ducklake it crashes with:
libc++abi: terminating due to uncaught exception of type duckdb::NotImplementedException: {"exception_type":"Not implemented","exception_message":"MERGE INTO with DuckLake only supports a single UPDATE/DELETE action currently"}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
I just learned about the
MATCHED BY SOURCE
directive which is pretty cool and very helpful when one would want to delete missing records.Following example works perfectly in plain DuckDB:
But when I try to use it inside a Ducklake it crashes with:
Beta Was this translation helpful? Give feedback.
All reactions