MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / arrow_min

Function arrow_min

nodedb/src/control/arrow_convert.rs:188–199  ·  view source on GitHub ↗

Compute MIN of a numeric column using Arrow SIMD kernels.

(batch: &RecordBatch, column_name: &str)

Source from the content-addressed store, hash-verified

186
187/// Compute MIN of a numeric column using Arrow SIMD kernels.
188pub fn arrow_min(batch: &RecordBatch, column_name: &str) -> Option<f64> {
189 let idx = batch.schema().index_of(column_name).ok()?;
190 let array = batch.column(idx);
191
192 if let Some(f64_arr) = array.as_any().downcast_ref::<Float64Array>() {
193 arrow::compute::kernels::aggregate::min(f64_arr)
194 } else if let Some(i64_arr) = array.as_any().downcast_ref::<Int64Array>() {
195 arrow::compute::kernels::aggregate::min(i64_arr).map(|v| v as f64)
196 } else {
197 None
198 }
199}
200
201/// Compute MAX of a numeric column using Arrow SIMD kernels.
202pub fn arrow_max(batch: &RecordBatch, column_name: &str) -> Option<f64> {

Callers

nothing calls this directly

Calls 3

okMethod · 0.45
schemaMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected