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 2020/06/01 00:33:18 UTC

[GitHub] [arrow] houqp commented on a change in pull request #7193: ARROW-7924: [Rust] Add sort for float types

houqp commented on a change in pull request #7193:
URL: https://github.com/apache/arrow/pull/7193#discussion_r433001233



##########
File path: rust/arrow/src/compute/kernels/sort.rs
##########
@@ -149,9 +167,13 @@ where
         .collect::<Vec<(u32, T::Native)>>();
     let mut nulls = null_indices;
     if !options.descending {
-        valids.sort_by_key(|a| a.1);
+        valids.sort_by(|a, b| a.1.partial_cmp(&b.1).unwrap_or_else(|| Ordering::Greater));

Review comment:
       i am kind of curious, have you done any benchmark to see if changing to partial_cmp with unwrap_or_else results in any performance difference? 




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