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

Function group_by_buckets_by_dim_value

nodedb-array/src/query/aggregate.rs:298–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296
297 #[test]
298 fn group_by_buckets_by_dim_value() {
299 let t = tile(&[
300 (0, Some(1.0)),
301 (1, Some(2.0)),
302 (0, Some(3.0)),
303 (1, Some(4.0)),
304 ]);
305 let g = group_by_dim(&t, 0, 0, Reducer::Sum);
306 assert_eq!(g.len(), 2);
307 // first-seen order: 0, then 1
308 assert_eq!(g[0].key, CoordValue::Int64(0));
309 assert_eq!(g[0].result.finalize(), Some(4.0));
310 assert_eq!(g[1].key, CoordValue::Int64(1));
311 assert_eq!(g[1].result.finalize(), Some(6.0));
312 }
313}

Callers

nothing calls this directly

Calls 2

group_by_dimFunction · 0.85
tileFunction · 0.70

Tested by

no test coverage detected