tustvold commented on code in PR #5015:
URL: https://github.com/apache/arrow-rs/pull/5015#discussion_r1380573339
##########
arrow-cast/src/cast.rs:
##########
@@ -2317,6 +2341,23 @@ fn value_to_string<O: OffsetSizeTrait>(
Ok(Arc::new(builder.finish()))
}
+fn cast_numeric_to_binary<FROM: ArrowPrimitiveType, O: OffsetSizeTrait>(
+ array: &dyn Array,
+) -> Result<ArrayRef, ArrowError> {
+ let array = array.as_primitive::<FROM>();
+
+ let mut builder =
+ GenericBinaryBuilder::<O>::with_capacity(array.len(),
array.values().inner().capacity());
Review Comment:
We reuse the buffer when converting between StringArray and BinaryArray, and
possibly some other transformations. I'm not sure why you wouldn't want to do
so if you're able to?
--
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]