Skip to main content

Module reduce

Module reduce 

Source
Expand description

The reductions: what an aggregation (SUM(x OVER T), CORREL(x, y OVER T), NPV(rate, cf OVER T)) computes from one group’s rows.

The dataflow hands a group over as Rows: every row’s position along each reduced category (so rows arrive in item order: the first row is the first item that has a cell) and its values, one per reduced measure in argument order. Parameters (rate, k, guess) have one value per group. The scalar evaluator never reduces (a scalar formula has no categories).

Families add their reductions in reduce/<family>.rs, dispatched by id range like builtins: P4 statistics own 1000–1099 and 1100–1149, P5 financial 1150–1199, P6 lookups 1200–1249.

Structs§

Rows
One group’s rows, in item order.

Functions§

array
A list of results (an [improv_core_model::functions::Kind::Array] function such as SORT), laid along the INTO category’s items in order.
per_item
One result per row (a [improv_core_model::functions::Kind::PerItem] function such as RANK): the i-th result belongs to the i-th row.
reduce
Reduce one group: aggregation func over rows with params.