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 2022/03/02 15:21:36 UTC

[GitHub] [arrow-rs] alamb commented on a change in pull request #1372: Add benchmark and take_iter_unchecked

alamb commented on a change in pull request #1372:
URL: https://github.com/apache/arrow-rs/pull/1372#discussion_r817798695



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -2214,19 +2214,23 @@ macro_rules! compare_dict_op {
             ));
         }
 
-        let left_iter = $left
-            .values()
-            .as_any()
-            .downcast_ref::<$value_ty>()
-            .unwrap()
-            .take_iter($left.keys_iter());
-
-        let right_iter = $right
-            .values()
-            .as_any()
-            .downcast_ref::<$value_ty>()
-            .unwrap()
-            .take_iter($right.keys_iter());
+        let left_iter = unsafe {

Review comment:
       ```suggestion
           // Safety justification: Since the inputs are valid Arrow arrays, all values are
           // valid indexes into the dictionary (which is verified during construction)
   
           let left_iter = 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.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org