(
array: &GenericListArray<O>,
is_min: bool,
)
| 200 | } |
| 201 | |
| 202 | fn array_min_max_helper<O: OffsetSizeTrait>( |
| 203 | array: &GenericListArray<O>, |
| 204 | is_min: bool, |
| 205 | ) -> Result<ArrayRef> { |
| 206 | // Try the primitive fast path first |
| 207 | if let Some(result) = try_primitive_array_min_max(array, is_min) { |
| 208 | return result; |
| 209 | } |
| 210 | |
| 211 | // Fallback: per-row ScalarValue path for non-primitive types |
| 212 | let agg_fn = if is_min { min_batch } else { max_batch }; |
| 213 | let null_value = ScalarValue::try_from(array.value_type())?; |
| 214 | let result_vec: Vec<ScalarValue> = array |
| 215 | .iter() |
| 216 | .map(|arr| arr.as_ref().map_or_else(|| Ok(null_value.clone()), agg_fn)) |
| 217 | .try_collect()?; |
| 218 | ScalarValue::iter_to_array(result_vec) |
| 219 | } |
| 220 | |
| 221 | /// Dispatches to a typed primitive min/max implementation, or returns `None` if |
| 222 | /// the element type is not a primitive. |
no test coverage detected
searching dependent graphs…