[bug]: Lose numeric zeros when rounding in duckdb
Open
bug
- Dominant language
- C++
- Stars
- 3.2k
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
### Description
```sql
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.
Contributor guide
Research direction
Start by running the SQL example under the PostgreSQL and DuckDB execution paths and comparing the numeric output. Trace how round(a, 2) represents and formats its result, then verify that 1.8000 is displayed as 1.80, 1.346 as 1.35, and the relevant TPCDS output matches PostgreSQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, postgres, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100