viirya commented on code in PR #1990:
URL: https://github.com/apache/arrow-rs/pull/1990#discussion_r914465665


##########
arrow/src/compute/kernels/arity.rs:
##########
@@ -78,10 +82,120 @@ where
     PrimitiveArray::<O>::from(data)
 }
 
+macro_rules! unary_dict_op {
+    ($array: expr, $op: expr, $value_ty: ty) => {{
+        // Safety justification: Since the inputs are valid Arrow arrays, all 
values are
+        // valid indexes into the dictionary (which is verified during 
construction)
+
+        let array_iter = unsafe {
+            $array
+                .values()
+                .as_any()
+                .downcast_ref::<$value_ty>()
+                .unwrap()
+                .take_iter_unchecked($array.keys_iter())

Review Comment:
   I thought it too, but didn't try. Let me try if it is feasible.



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