Skip to content
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

Casting from string to decimal should check overflow #7497

Closed
jonahgao opened this issue Sep 7, 2023 · 2 comments
Closed

Casting from string to decimal should check overflow #7497

jonahgao opened this issue Sep 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jonahgao
Copy link
Member

jonahgao commented Sep 7, 2023

Describe the bug

To Reproduce:

DataFusion CLI v30.0.0
❯ select cast('1000' as decimal(10,8));
+--------------+
| Utf8("1000") |
+--------------+
| 10.00000000  |
+--------------+
1 row in set. Query took 0.045 seconds.

To Reproduce

No response

Expected behavior

It should raise an overflow error, like in PostgreSQL.

postgres=# select cast('1000' as decimal(10,8));
ERROR:  numeric field overflow
DETAIL:  A field with precision 10, scale 8 must round to an absolute value less than 10^2

Additional context

No response

@jonahgao jonahgao added the bug Something isn't working label Sep 7, 2023
@alamb
Copy link
Contributor

alamb commented Sep 7, 2023

This may be an issue in arrow-rs 's cast kernel, which DataFusion uses

@jonahgao
Copy link
Member Author

Fixed in upstream apache/arrow-rs#4830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants