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 06:14:21 UTC

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

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



##########
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:
       You might be able to do something like `Ok(Array.clone())` instead?




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