comphead commented on code in PR #13554:
URL: https://github.com/apache/datafusion/pull/13554#discussion_r1862667080
##########
datafusion/functions-aggregate/src/median.rs:
##########
@@ -310,6 +311,20 @@ impl<T: ArrowNumericType> Accumulator for
DistinctMedianAccumulator<T> {
}
}
+/// Get maximum entry in the slice,
+fn slice_max<T>(array: &[T::Native]) -> T::Native
+where
+ T: ArrowPrimitiveType,
+ T::Native: PartialOrd, // Ensure the type supports PartialOrd for
comparison
+{
+ // Make sure that, array is not empty.
+ debug_assert!(!array.is_empty());
+ *array
Review Comment:
```suggestion
// `.unwrap()` is safe here as the array is supposed to be non-empty
*array
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]