dringtech / lume-duck

DuckDB data in Lume
MIT License
0 stars 1 forks source link

Null values are being converted to 0 in 'double' column type. #1

Open luke-strange opened 3 months ago

luke-strange commented 3 months ago

I have a data file with columns containing null values. When these are loaded by lume-duck, they are converted to 0s.

My data is loaded in a .sql file, which is called in a generator function in an index.page.ts file.

I tested DuckDB in the command line and it seems to deal with null values fine:

Screenshot 2024-08-08 at 14 13 15

I'm currently using a workaround in the generator function to replace 0 with null, but this is kludgy:

Screenshot 2024-08-08 at 14 25 00

gilesdring commented 2 months ago

I've added a test that shows that creating a simple test table and inserting nulls works. Will see if I can reproduce this...

gilesdring commented 2 months ago

This seems to be down to a caching issue in the duckdb bindings that are used. Basically the first query works OK (returning null as expected), but the second one returns 0 instead. v0.2.1 should fix this very odd behaviour (although it is a bit of a workaround).