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


##########
arrow/src/compute/kernels/aggregate.rs:
##########
@@ -215,6 +215,70 @@ where
     }
 }
 
+/// Returns the min of values in the array.
+pub fn min_dyn<T, A: ArrayAccessor<Item = T::Native>>(array: A) -> 
Option<T::Native>
+where
+    T: ArrowNumericType,
+    T::Native: Add<Output = T::Native>,
+{
+    match array.data_type() {
+        DataType::Dictionary(_, _) => {
+            let null_count = array.null_count();
+
+            if null_count == array.len() {
+                return None;
+            }
+
+            let mut has_value = false;
+            let mut n = T::default_value();
+            let iter = ArrayIter::new(array);
+            iter.into_iter().for_each(|value| {
+                if let Some(value) = value {
+                    if !has_value || value < n {

Review Comment:
   Handled it now and added a test.



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