Dandandan commented on code in PR #13554:
URL: https://github.com/apache/datafusion/pull/13554#discussion_r1856325958


##########
datafusion/functions-aggregate/src/median.rs:
##########
@@ -310,6 +310,18 @@ impl<T: ArrowNumericType> Accumulator for 
DistinctMedianAccumulator<T> {
     }
 }
 
+/// Get maximum entry in the slice,
+fn slice_max<T>(array: &[T::Native]) -> Option<T::Native>
+where
+    T: ArrowPrimitiveType,
+    T::Native: PartialOrd, // Ensure the type supports PartialOrd for 
comparison
+{

Review Comment:
   As `unwrap` is used, the code could be updated / simplified to work on 
arrays of size >= 1



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

Reply via email to