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


##########
arrow/src/compute/kernels/aggregate.rs:
##########
@@ -215,6 +215,68 @@ where
     }
 }
 
+/// Returns the min of values in the array.
+pub fn min_array<T, A: ArrayAccessor<Item = T::Native>>(array: A) -> 
Option<T::Native>
+where
+    T: ArrowNumericType,
+    T::Native: ArrowNativeType,
+{
+    min_max_dyn_helper::<T, A, _, _>(
+        array,
+        |a, b| (!is_nan(*a) & is_nan(*b)) || a < b,
+        min,
+    )
+}
+
+/// Returns the max of values in the array.
+pub fn max_array<T, A: ArrayAccessor<Item = T::Native>>(array: A) -> 
Option<T::Native>
+where
+    T: ArrowNumericType,
+    T::Native: ArrowNativeType,
+{
+    min_max_dyn_helper::<T, A, _, _>(
+        array,
+        |a, b| (is_nan(*a) & !is_nan(*b)) || a > b,
+        max,
+    )
+}
+
+fn min_max_dyn_helper<T, A: ArrayAccessor<Item = T::Native>, F, M>(

Review Comment:
   ```suggestion
   fn min_max_array_helper<T, A: ArrayAccessor<Item = T::Native>, F, M>(
   ```



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