-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
What happens?
As mentioned in #5362
Because of the limited size of the physical type of a DECIMAL, sometimes we don't have enough room to hold enough information to properly round later on.
To elaborate:
We register the exceeding decimals, because depending on the exponent (which we don't know at that time) those decimal values might become digit
values instead.
But if the source value has more decimals than the physical type of the decimal can hold, we can't register them - which might become a problem depending on the exponent.
Example: (4 width is the max for physical type SMALLINT)
select '1.2345e2'::DECIMAL(4,1);
-- psql
123.5
-- duckdb
123.4
To Reproduce
query I
select '1.2345e2'::DECIMAL(4,1);
----
123.5
Current result is 123.4
OS:
MacOS
DuckDB Version:
master
DuckDB Client:
unittest
Full Name:
Thijs Bruineman
Affiliation:
DuckDB Labs
Have you tried this on the latest master
branch?
- I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- I agree