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

Function apply_v_aggregate

nodedb-query/src/window/value_agg.rs:14–30  ·  view source on GitHub ↗
(
    rows: &mut [Vec<Value>],
    indices: &[usize],
    column_index: &HashMap<String, usize>,
    spec: &WindowFuncSpec,
    write_col: usize,
)

Source from the content-addressed store, hash-verified

12use crate::simd_agg;
13
14pub(super) fn apply_v_aggregate(
15 rows: &mut [Vec<Value>],
16 indices: &[usize],
17 column_index: &HashMap<String, usize>,
18 spec: &WindowFuncSpec,
19 write_col: usize,
20) {
21 let use_running = spec.frame.mode == "range"
22 && matches!(spec.frame.start, FrameBound::UnboundedPreceding)
23 && matches!(spec.frame.end, FrameBound::CurrentRow);
24
25 if use_running {
26 apply_v_running_aggregate(rows, indices, column_index, spec, write_col);
27 } else {
28 apply_v_per_row_aggregate(rows, indices, column_index, spec, write_col);
29 }
30}
31
32fn eval_arg(spec: &WindowFuncSpec, row: &[Value], column_index: &HashMap<String, usize>) -> Value {
33 spec.args

Callers 2

run_aggFunction · 0.85

Calls 2

Tested by

no test coverage detected