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

Function plan_homogenizing_function

src/sql/src/plan/query.rs:4276–4295  ·  view source on GitHub ↗
(
    ecx: &ExprContext,
    function: &HomogenizingFunction,
    exprs: &[Expr<Aug>],
)

Source from the content-addressed store, hash-verified

4274}
4275
4276fn plan_homogenizing_function(
4277 ecx: &ExprContext,
4278 function: &HomogenizingFunction,
4279 exprs: &[Expr<Aug>],
4280) -> Result<CoercibleScalarExpr, PlanError> {
4281 assert!(!exprs.is_empty()); // `COALESCE()` is a syntax error
4282 let expr = HirScalarExpr::call_variadic(
4283 match function {
4284 HomogenizingFunction::Coalesce => VariadicFunc::from(Coalesce),
4285 HomogenizingFunction::Greatest => VariadicFunc::from(Greatest),
4286 HomogenizingFunction::Least => VariadicFunc::from(Least),
4287 },
4288 coerce_homogeneous_exprs(
4289 &ecx.with_name(&function.to_string().to_lowercase()),
4290 plan_exprs(ecx, exprs)?,
4291 None,
4292 )?,
4293 );
4294 Ok(expr.into())
4295}
4296
4297fn plan_field_access(
4298 ecx: &ExprContext,

Callers 1

plan_expr_innerFunction · 0.85

Calls 4

coerce_homogeneous_exprsFunction · 0.85
plan_exprsFunction · 0.85
with_nameMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected