MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / reduce

Method reduce

src/expr/src/relation.rs:1327–1340  ·  view source on GitHub ↗

Perform a key-wise reduction / aggregation. The `group_key` argument indicates columns in the input collection that should be grouped, and `aggregates` lists aggregation functions each of which produces one output column in addition to the keys.

(
        self,
        group_key: Vec<usize>,
        aggregates: Vec<AggregateExpr>,
        expected_group_size: Option<u64>,
    )

Source from the content-addressed store, hash-verified

1325 /// be grouped, and `aggregates` lists aggregation functions each of which produces
1326 /// one output column in addition to the keys.
1327 pub fn reduce(
1328 self,
1329 group_key: Vec<usize>,
1330 aggregates: Vec<AggregateExpr>,
1331 expected_group_size: Option<u64>,
1332 ) -> Self {
1333 MirRelationExpr::Reduce {
1334 input: Box::new(self),
1335 group_key: group_key.into_iter().map(MirScalarExpr::column).collect(),
1336 aggregates,
1337 monotonic: false,
1338 expected_group_size,
1339 }
1340 }
1341
1342 /// Perform a key-wise reduction order by and limit.
1343 ///

Callers 1

distinct_byMethod · 0.45

Calls 3

collectMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected