diff --git a/arrow-arith/src/aggregate.rs b/arrow-arith/src/aggregate.rs index 91623bc22b92..0fbddbc6e6df 100644 --- a/arrow-arith/src/aggregate.rs +++ b/arrow-arith/src/aggregate.rs @@ -809,6 +809,15 @@ where /// Returns the minimum value in the array, according to the natural order. /// For floating point arrays any NaN values are considered to be greater than any other non-null value +/// +/// # Example +/// ```rust +/// # use arrow_array::Int32Array; +/// # use arrow_arith::aggregate::min; +/// let array = Int32Array::from(vec![8, 2, 4]); +/// let result = min(&array); +/// assert_eq!(result, Some(2)); +/// ``` pub fn min(array: &PrimitiveArray) -> Option where T::Native: PartialOrd, @@ -818,6 +827,15 @@ where /// Returns the maximum value in the array, according to the natural order. /// For floating point arrays any NaN values are considered to be greater than any other non-null value +/// +/// # Example +/// ```rust +/// # use arrow_array::Int32Array; +/// # use arrow_arith::aggregate::max; +/// let array = Int32Array::from(vec![4, 8, 2]); +/// let result = max(&array); +/// assert_eq!(result, Some(8)); +/// ``` pub fn max(array: &PrimitiveArray) -> Option where T::Native: PartialOrd,