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

panic when parsing float as decimal #7626

Closed
jonahgao opened this issue Sep 22, 2023 · 0 comments · Fixed by #7627
Closed

panic when parsing float as decimal #7626

jonahgao opened this issue Sep 22, 2023 · 0 comments · Fixed by #7627
Labels
bug Something isn't working

Comments

@jonahgao
Copy link
Member

Describe the bug

Set the option datafusion.sql_parser.parse_float_as_decimal to true, and then input a decimal data that exceeds the maximum precision, it will panic.

To Reproduce

DataFusion CLI v31.0.0
❯ set datafusion.sql_parser.parse_float_as_decimal=true;
0 rows in set. Query took 0.003 seconds.
❯ select 123456789.012345678901234567890123456789;
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidArgumentError("precision 39 is greater than max 38")', arrow-datafusion/datafusion/common/src/scalar.rs:1729:18

Expected behavior

Return an Error instead of panic.

Additional context

No response

@jonahgao jonahgao added the bug Something isn't working label Sep 22, 2023
@jonahgao jonahgao changed the title panic when setting parse_float_as_decimal to true panic when parsing float as decimal Sep 22, 2023
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

Successfully merging a pull request may close this issue.

1 participant