pg_duckdb icon indicating copy to clipboard operation
pg_duckdb copied to clipboard

[bug]: Lose numeric zeros when rounding in duckdb

Open JelteF opened this issue 1 year ago • 1 comments

Description

create table t(a numeric);
insert into t values (1.8000), (1.346);
select round(a, 2) from t;

With PG execution this returns:

 round
───────
  1.80
  1.35

With DuckDB execution this returns:

 round
───────
   1.8
  1.35

So we somehow lose the trailing 0 after rounding to two decimals. This causes differences in TPCDS output.

JelteF avatar Oct 18 '24 09:10 JelteF

FYI it seems that's because NUMERIC without a size is downgraded to a double in duckdb. I'm wondering if that's what we actually want to do.

JelteF avatar Oct 21 '24 09:10 JelteF