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

Function rows_frame_min_max

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

Source from the content-addressed store, hash-verified

531
532 #[test]
533 fn rows_frame_min_max() {
534 let cols = ci(&["v"]);
535 let f = frame(
536 "rows",
537 FrameBound::UnboundedPreceding,
538 FrameBound::UnboundedFollowing,
539 );
540
541 let mut rows = rows_v(&[3, 1, 2]);
542 let mn = agg_spec("min", f.clone(), vec![]);
543 run_agg(&mut rows, &cols, &mn);
544 assert!((rows[0][1].as_f64().unwrap() - 1.0).abs() < 1e-9);
545
546 let mut rows = rows_v(&[3, 1, 2]);
547 let mx = agg_spec("max", f, vec![]);
548 run_agg(&mut rows, &cols, &mx);
549 assert!((rows[0][1].as_f64().unwrap() - 3.0).abs() < 1e-9);
550 }
551
552 #[test]
553 fn first_and_last_value() {

Callers

nothing calls this directly

Calls 6

frameFunction · 0.85
agg_specFunction · 0.85
run_aggFunction · 0.85
ciFunction · 0.70
rows_vFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected