tustvold commented on code in PR #2923:
URL: https://github.com/apache/arrow-rs/pull/2923#discussion_r1007223889


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -336,10 +356,25 @@ where
 
     // with_precision_and_scale validates the
     // value is within range for the output precision
-    cast_primitive_to_decimal(array, |v| v.as_() * mul, precision, scale)
+    cast_primitive_to_decimal128(array, |v| v.as_() * mul, precision, scale)
+}
+
+fn cast_integer_to_decimal256<T: ArrowNumericType>(
+    array: &PrimitiveArray<T>,
+    precision: u8,
+    scale: u8,
+) -> Result<ArrayRef>
+where
+    <T as ArrowPrimitiveType>::Native: AsPrimitive<i256>,
+{
+    let mul: i256 = i256::from_i128(10_i128.pow(scale as u32));

Review Comment:
   Yes, 
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2075e33b76d4894200dfe15d2a2cc37b
   
   I suspect the max is DECIMAL128_MAX_SCALE which is 38



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to