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

Function run_agg

nodedb-query/src/window/value_agg.rs:449–456  ·  view source on GitHub ↗

Drive `apply_v_aggregate` over the whole single-partition row set the same way `evaluate_window_functions_value` does (push a Null cell, then fill it), returning the produced column.

(rows: &mut [Vec<Value>], cols: &HashMap<String, usize>, spec: &WindowFuncSpec)

Source from the content-addressed store, hash-verified

447 /// same way `evaluate_window_functions_value` does (push a Null cell, then
448 /// fill it), returning the produced column.
449 fn run_agg(rows: &mut [Vec<Value>], cols: &HashMap<String, usize>, spec: &WindowFuncSpec) {
450 let write_col = rows.first().map(|r| r.len()).unwrap_or(0);
451 for row in rows.iter_mut() {
452 row.push(Value::Null);
453 }
454 let indices: Vec<usize> = (0..rows.len()).collect();
455 apply_v_aggregate(rows, &indices, cols, spec, write_col);
456 }
457
458 fn frame(mode: &str, start: FrameBound, end: FrameBound) -> WindowFrame {
459 WindowFrame {

Callers 6

rows_frame_sliding_sumFunction · 0.85
rows_frame_count_and_avgFunction · 0.85
rows_frame_min_maxFunction · 0.85
first_and_last_valueFunction · 0.85

Calls 6

apply_v_aggregateFunction · 0.85
firstMethod · 0.80
iter_mutMethod · 0.80
collectMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45

Tested by 6

rows_frame_sliding_sumFunction · 0.68
rows_frame_count_and_avgFunction · 0.68
rows_frame_min_maxFunction · 0.68
first_and_last_valueFunction · 0.68