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

Method typecheck_aggregate

src/transform/src/typecheck.rs:1567–1580  ·  view source on GitHub ↗

Typecheck an `AggregateExpr`

(
        &self,
        expr: &'a AggregateExpr,
        source: &'a MirRelationExpr,
        column_types: &[ReprColumnType],
    )

Source from the content-addressed store, hash-verified

1565
1566 /// Typecheck an `AggregateExpr`
1567 pub fn typecheck_aggregate<'a>(
1568 &self,
1569 expr: &'a AggregateExpr,
1570 source: &'a MirRelationExpr,
1571 column_types: &[ReprColumnType],
1572 ) -> Result<ReprColumnType, TypeError<'a>> {
1573 self.checked_recur(|tc| {
1574 let t_in = tc.typecheck_scalar(&expr.expr, source, column_types)?;
1575
1576 // TODO check that t_in is actually acceptable for `func`
1577
1578 Ok(expr.func.output_type(t_in))
1579 })
1580 }
1581}
1582
1583/// Detailed type error logging as a warning, with failures in CI and a logged error in production

Callers 1

typecheckMethod · 0.80

Calls 3

checked_recurMethod · 0.80
typecheck_scalarMethod · 0.80
output_typeMethod · 0.45

Tested by

no test coverage detected