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 2021/06/23 07:35:51 UTC

[GitHub] [arrow-rs] Jimexist commented on a change in pull request #492: concatenating single element array shortcut

Jimexist commented on a change in pull request #492:
URL: https://github.com/apache/arrow-rs/pull/492#discussion_r656836314



##########
File path: arrow/src/compute/kernels/concat.rs
##########
@@ -57,6 +57,9 @@ pub fn concat(arrays: &[&Array]) -> Result<ArrayRef> {
         return Err(ArrowError::ComputeError(
             "concat requires input of at least one array".to_string(),
         ));
+    } else if arrays.len() == 1 {
+        let array = arrays[0];
+        return Ok(array.slice(0, array.len()));

Review comment:
       sadly `Array` isn't cloneable




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org