liukun4515 commented on a change in pull request #1073:
URL: https://github.com/apache/arrow-rs/pull/1073#discussion_r773544585
##########
File path: arrow/src/compute/kernels/cast.rs
##########
@@ -281,6 +285,56 @@ macro_rules! cast_floating_point_to_decimal {
}};
}
+// cast the decimal array to integer array
+macro_rules! cast_decimal_to_integer {
+ ($ARRAY:expr, $SCALE : ident, $VALUE_BUILDER: ident, $NATIVE_TYPE : ident,
$DATA_TYPE : expr) => {{
+ let array = $ARRAY.as_any().downcast_ref::<DecimalArray>().unwrap();
+ let mut value_builder = $VALUE_BUILDER::new(array.len());
+ let div: i128 = 10_i128.pow(*$SCALE as u32);
+ let min_bound = ($NATIVE_TYPE::MIN) as i128;
+ let max_bound = ($NATIVE_TYPE::MAX) as i128;
+ for i in 0..array.len() {
Review comment:
add follow-up issue to track this enhancement.
https://github.com/apache/arrow-rs/issues/1083
--
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]