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



##########
File path: arrow/src/compute/kernels/sort.rs
##########
@@ -805,7 +806,17 @@ pub fn lexsort(columns: &[SortColumn], limit: 
Option<usize>) -> Result<Vec<Array
     let indices = lexsort_to_indices(columns, limit)?;
     columns
         .iter()
-        .map(|c| take(c.values.as_ref(), &indices, None))
+        .map(|c| {
+            take(
+                c.values.as_ref(),
+                &indices,
+                // disable bound check overhead since indices are already 
generated from
+                // the same record batch
+                Some(TakeOptions {

Review comment:
       The `Default` of `TakeOptions` is already `checkbounds: false`, so this 
does the same.
   
https://github.com/apache/arrow-rs/blob/master/arrow/src/compute/kernels/take.rs#L262
   It does do *some* bound checking in the inner loop (as otherwise the method 
would be unsafe).




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


Reply via email to