Skip to content

Decimal and Double issues in DuckDb #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liun03 opened this issue Jun 2, 2023 · 0 comments · Fixed by #261
Closed

Decimal and Double issues in DuckDb #258

liun03 opened this issue Jun 2, 2023 · 0 comments · Fixed by #261

Comments

@liun03
Copy link
Contributor

liun03 commented Jun 2, 2023

We use DuckDb as a cache in pre-aggregation and there are some rounding issues with decimals.

When we parse a statement, we need an option ParsingOptions to decide the decimal casting strategy.
Sample SQL:

SELECT * FROM MY_TABLE WHERE DECIMAL_FIELD = 1.23

AS_DOUBLE: rewritten as SELECT * FROM MY_TABLE WHERE DECIMAL_FIELD = 1.23E0
AS_DECIMAL: rewritten as SELECT * FROM MY_TABLE WHERE DECIMAL_FIELD = DECIMAL '1.23'

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant