You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/18 01:57:57 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2872: Add downcast_integer and downcast_primitive
tustvold commented on code in PR #2872:
URL: https://github.com/apache/arrow-rs/pull/2872#discussion_r997646085
##########
arrow-array/src/cast.rs:
##########
@@ -24,221 +24,221 @@ use crate::types::*;
#[doc(hidden)]
#[macro_export]
macro_rules! repeat_pat {
- ($e:pat, $v_:ident) => {
+ ($e:pat, $v_:expr) => {
$e
};
- ($e:pat, $v_:ident $(, $tail:ident)+) => {
+ ($e:pat, $v_:expr $(, $tail:expr)+) => {
($e, $crate::repeat_pat!($e $(, $tail)+))
}
}
-/// Downcast an [`Array`] to a [`PrimitiveArray`] based on its [`DataType`]
-/// accepts a number of subsequent patterns to match the data type
+/// Given one or more expressions evaluating to integer [`DataType`] invokes the provided macro
+/// `m` with the corresponding [`ArrowPrimitiveType`], followed by any additional arguments
Review Comment:
This also downcasts floats and decimals?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org