ducklake icon indicating copy to clipboard operation
ducklake copied to clipboard

Default values for columns cause Invalid Error

Open onnimonni opened this issue 2 months ago • 1 comments

What happens?

I'm trying to create a table with default value into ducklake and it fails:

CREATE TABLE my_timeseries (ts TIMESTAMP, x DOUBLE PRECISION, y DOUBLE PRECISION, is_deleted BOOLEAN DEFAULT FALSE);
Invalid Error:
Unknown exception in ExecutorTask::Execute

I tried to check from the docs and didn't find anything related to if these should be supported or not: https://ducklake.select/docs/stable/duckdb/introduction

And if they would not be supported I assumed there would be more human readable error.

Thanks again 😊!

To Reproduce

INSTALL ducklake;
ATTACH 'ducklake:my_ducklake.ducklake' AS my_ducklake;

USE my_ducklake;

CREATE TABLE my_timeseries (ts TIMESTAMP, x DOUBLE PRECISION, y DOUBLE PRECISION, is_deleted BOOLEAN DEFAULT FALSE);

OS:

MacOS 15.6.1

DuckDB Version:

v1.4.0 (Andium) b8a06e4a22

DuckLake Version:

45788f0

DuckDB Client:

CLI

Hardware:

Macbook Pro M1 Pro

Full Name:

Onni Hakala

Affiliation:

Freelancer

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • [x] Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • [x] Yes, I have

onnimonni avatar Sep 26 '25 08:09 onnimonni

Hey! I don't get the same error as you do, actually I get quite a nice error:

Not implemented Error:
Only literals (e.g. 42 or 'hello world') are supported as default values

What I am not sure right now is why TRUE and FALSE are not considered literals. This statement does work like this:

CREATE TABLE my_timeseries (ts TIMESTAMP, x DOUBLE PRECISION, y DOUBLE PRECISION, is_deleted BOOLEAN DEFAULT 1);

Which is interesting.

Do you know if this is a limitation of the parser @pdet ?

Btw, the only literals are supported as default values is documented --> https://ducklake.select/docs/stable/duckdb/unsupported_features

guillesd avatar Sep 26 '25 11:09 guillesd

This should now be supported in the DuckLake version that will come with DuckDB v1.5

See https://github.com/duckdb/ducklake/pull/571

pdet avatar Dec 05 '25 18:12 pdet