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

Function sum

nodedb-query/src/msgpack_scan/aggregate.rs:445–454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

443
444 #[test]
445 fn sum() {
446 let d1 = encode(&json!({"v": 10}));
447 let d2 = encode(&json!({"v": 20}));
448 let d3 = encode(&json!({"v": 30}));
449 let docs: Vec<&[u8]> = vec![&d1, &d2, &d3];
450 assert_eq!(
451 compute_aggregate_binary("sum", "v", None, &docs),
452 Value::Float(60.0)
453 );
454 }
455
456 #[test]
457 fn avg() {

Callers 1

arrow_sumFunction · 0.85

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected