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/08/16 15:19:56 UTC
[GitHub] [arrow-rs] psvri commented on a diff in pull request #2456: Utf8array casting
psvri commented on code in PR #2456:
URL: https://github.com/apache/arrow-rs/pull/2456#discussion_r946916256
##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1254,6 +1258,24 @@ pub fn cast_with_options(
}
}
+/// Cast to string array to binary array
+fn cast_string_to_binary<OffsetSize>(array: &ArrayRef) -> Result<ArrayRef>
+where
+ OffsetSize: OffsetSizeTrait,
+{
+ let array = array
+ .as_any()
+ .downcast_ref::<GenericStringArray<OffsetSize>>()
+ .unwrap();
+
+ Ok(Arc::new(
+ array
+ .iter()
+ .map(|x| x.map(|data| data.as_bytes()))
+ .collect::<GenericBinaryArray<OffsetSize>>(),
Review Comment:
Fixed it in latest commit
--
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