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/01/22 07:20:56 UTC

[GitHub] [arrow] jorgecarleitao commented on a change in pull request #9291: ARROW-11345: Made most ops not rely on `value(i)`

jorgecarleitao commented on a change in pull request #9291:
URL: https://github.com/apache/arrow/pull/9291#discussion_r562432512



##########
File path: rust/arrow/src/array/ord.rs
##########
@@ -66,7 +68,9 @@ where
 {
     let left = left.as_any().downcast_ref::<PrimitiveArray<T>>().unwrap();
     let right = right.as_any().downcast_ref::<PrimitiveArray<T>>().unwrap();
-    Box::new(move |i, j| cmp_nans_last(&left.value(i), &right.value(j)))
+    let left = left.values();
+    let right = right.values();
+    Box::new(move |i, j| cmp_nans_last(&left[i], &right[j]))

Review comment:
       this will be slower, but at this point we have no guarantee that `i` and `j` are within bounds.




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