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

Function arrow_sum_works

nodedb/src/control/arrow_convert.rs:263–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

261
262 #[test]
263 fn arrow_sum_works() {
264 let json = r#"[
265 {"id": "d1", "data": {"price": 10.5}},
266 {"id": "d2", "data": {"price": 20.0}},
267 {"id": "d3", "data": {"price": 30.0}}
268 ]"#;
269
270 let batch = json_rows_to_record_batch(json).unwrap();
271 let total = arrow_sum(&batch, "price").unwrap();
272 assert!((total - 60.5).abs() < 0.01);
273 }
274
275 #[test]
276 fn empty_input() {

Callers

nothing calls this directly

Calls 2

arrow_sumFunction · 0.85

Tested by

no test coverage detected