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
#[test] fn test_cast_decimal128_to_decimal256_negative() { let input_type = DataType::Decimal128(10, 3); let output_type = DataType::Decimal256(10, 5); assert!(can_cast_types(&input_type, &output_type)); let array = vec![Some(i128::MAX), Some(i128::MIN)]; let input_decimal_array = create_decimal_array(array, 10, 3).unwrap(); let array = Arc::new(input_decimal_array) as ArrayRef; let hundred = i256::from_i128(100); generate_cast_test_case!( &array, Decimal256Array, &output_type, vec![ Some(i256::from_i128(i128::MAX).mul_wrapping(hundred)), Some(i256::from_i128(i128::MIN).mul_wrapping(hundred)) ] ); }
Fails with
thread 'cast::tests::test_cast_decimal128_to_decimal256_negative' panicked at 'assertion failed: `(left == right)` left: `0`, right: `17014118346046923173168730371588410572700`', arrow-cast/src/cast.rs:7251:9
The issue is that it is not performing the scaling operation in the destination type
let iter = array.iter().map(|v| { v.and_then(|v| v.mul_checked(mul).ok().map(i256::from_i128)) }); let casted_array = unsafe { PrimitiveArray::<Decimal256Type>::from_trusted_len_iter(iter) }; casted_array .with_precision_and_scale(*output_precision, *output_scale) .map(|a| Arc::new(a) as ArrayRef)
To Reproduce
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered:
label_issue.py automatically added labels {'arrow'} from #3264
label_issue.py
Sorry, something went wrong.
tustvold
Successfully merging a pull request may close this issue.
Describe the bug
Fails with
The issue is that it is not performing the scaling operation in the destination type
To Reproduce
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered: