liukun4515 commented on code in PR #4088:
URL: https://github.com/apache/arrow-rs/pull/4088#discussion_r1167543788


##########
arrow-cast/src/cast.rs:
##########
@@ -2081,29 +2081,102 @@ impl DecimalCast for i256 {
     }
 }
 
-fn cast_decimal_to_decimal<I, O>(
-    array: &PrimitiveArray<I>,
-    input_scale: i8,
+fn cast_decimal_to_decimal_error<O>(
     output_precision: u8,
     output_scale: i8,
-    cast_options: &CastOptions,
-) -> Result<ArrayRef, ArrowError>
+) -> impl Fn(<O as ArrowPrimitiveType>::Native) -> ArrowError
 where
-    I: DecimalType,
     O: DecimalType,
-    I::Native: DecimalCast + ArrowNativeTypeOp,
     O::Native: DecimalCast + ArrowNativeTypeOp,
 {
-    let error = |x| {
+    move |x: O::Native| {
         ArrowError::CastError(format!(
             "Cannot cast to {}({}, {}). Overflowing on {:?}",
             O::PREFIX,
             output_precision,
             output_scale,
             x
         ))
+    }
+}
+
+fn cast_decimal_to_decimal_same_type<T>(

Review Comment:
   Not same args, 
   `cast_decimal_to_decimal_same_type` just accept the one type of decimal of 
`T`.



-- 
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