We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Casting from string to decimal does not perform a precision overflow check.
To Reproduce
use arrow::array::types::Decimal128Type; use arrow::array::{AsArray, StringArray}; use arrow::compute::{cast_with_options, CastOptions}; use arrow::datatypes::DataType; fn main() { let str_array = StringArray::from(vec!["1000".to_string()]); let output_type = DataType::Decimal128(10, 8); let mut option = CastOptions::default(); option.safe = false; let casted_array = cast_with_options(&str_array, &output_type, &option).unwrap(); let decimal_array = casted_array.as_primitive::<Decimal128Type>(); println!("{:?}", decimal_array.value_as_string(0)); }
The execution result of the above program is "10.00000000".
Expected behavior
It should panic and report an overflow.
Additional context
The text was updated successfully, but these errors were encountered:
cast_string_to_decimal
label_issue.py automatically added labels {'arrow'} from #4830
label_issue.py
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
Casting from string to decimal does not perform a precision overflow check.
To Reproduce
The execution result of the above program is "10.00000000".
Expected behavior
It should panic and report an overflow.
Additional context
The text was updated successfully, but these errors were encountered: