You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/02/06 10:35:04 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3667: Use dyn Array in cast kernels

tustvold commented on code in PR #3667:
URL: https://github.com/apache/arrow-rs/pull/3667#discussion_r1097205458


##########
arrow-cast/src/cast.rs:
##########
@@ -609,7 +609,7 @@ pub fn cast_with_options(
 
     // clone array if types are the same
     if from_type == to_type {
-        return Ok(array.clone());
+        return Ok(make_array(array.data().clone()));

Review Comment:
   This is the only "downside", in practice cloning ArrayData is relied on to be fast, it underpins array slicing, and so I think this is fine



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