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/04/29 18:35:15 UTC

[GitHub] [arrow-rs] medwards commented on a change in pull request #236: sort_primitive result is capped to the min of limit or values.len

medwards commented on a change in pull request #236:
URL: https://github.com/apache/arrow-rs/pull/236#discussion_r623297164



##########
File path: arrow/src/compute/kernels/sort.rs
##########
@@ -487,24 +487,27 @@ where
         len = limit.min(len);
     }
     if !descending {
-        sort_by(&mut valids, len - nulls_len, |a, b| cmp(a.1, b.1));
+        sort_by(&mut valids, len.saturating_sub(nulls_len), |a, b| {

Review comment:
       Looking at your diff I think one of us has misunderstood the expected behaviour. I think the result should be `ArrayData` truncated to the limit as if the full input was sorted, with some control over whether nulls are ordered before or after real values.




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