askoa commented on code in PR #3695:
URL: https://github.com/apache/arrow-rs/pull/3695#discussion_r1106605544


##########
arrow-ord/src/sort.rs:
##########
@@ -599,6 +618,206 @@ fn insert_valid_values<T>(result_slice: &mut [u32], 
offset: usize, valids: &[(u3
     append_valids(&mut result_slice[offset..offset + valids.len()]);
 }
 
+// Sort run array and return sorted run array.
+// The output RunArray will be encoded at the same level as input run array.
+// For e.g. an input RunArray { run_ends = [2,4,6,8], values = [1,2,1,2] }
+// will result in output RunArray { run_ends = [2,4,6,8], values = [1,1,2,2] }
+// and not RunArray { run_ends = [4,8], values = [1,2] }
+fn sort_run(

Review Comment:
   It's going to take lot more time as `take_run` has to convert the logical 
indices to physical indices. Based on latest `take_run` benchmark results 
(https://github.com/apache/arrow-rs/pull/3705), it is around 30 µs. So 
`sort_to_indices + take` might take some where around 40 µs compared to 10 µs 
taken by `sort_run`
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to