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

Function rows_frame_sliding_sum

nodedb-query/src/window/value_agg.rs:491–502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

489
490 #[test]
491 fn rows_frame_sliding_sum() {
492 let cols = ci(&["v"]);
493 let mut rows = rows_v(&[10, 20, 30]);
494 let s = agg_spec(
495 "sum",
496 frame("rows", FrameBound::Preceding(1), FrameBound::CurrentRow),
497 vec![(col("v"), true)],
498 );
499 run_agg(&mut rows, &cols, &s);
500 let got: Vec<f64> = rows.iter().map(|r| r[1].as_f64().unwrap()).collect();
501 assert_eq!(got, vec![10.0, 30.0, 50.0]);
502 }
503
504 #[test]
505 fn rows_frame_count_and_avg() {

Callers

nothing calls this directly

Calls 8

agg_specFunction · 0.85
frameFunction · 0.85
run_aggFunction · 0.85
collectMethod · 0.80
ciFunction · 0.70
rows_vFunction · 0.70
iterMethod · 0.45
as_f64Method · 0.45

Tested by

no test coverage detected