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

Function arrow_count

nodedb/src/control/arrow_convert.rs:216–220  ·  view source on GitHub ↗

Compute COUNT of non-null values in a column.

(batch: &RecordBatch, column_name: &str)

Source from the content-addressed store, hash-verified

214
215/// Compute COUNT of non-null values in a column.
216pub fn arrow_count(batch: &RecordBatch, column_name: &str) -> Option<usize> {
217 let idx = batch.schema().index_of(column_name).ok()?;
218 let array = batch.column(idx);
219 Some(array.len() - array.null_count())
220}
221
222/// Compute AVG of a numeric column (SUM / COUNT).
223pub fn arrow_avg(batch: &RecordBatch, column_name: &str) -> Option<f64> {

Callers 1

arrow_avgFunction · 0.85

Calls 4

okMethod · 0.45
schemaMethod · 0.45
columnMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected