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

Function plan_array_subquery

src/sql/src/plan/query.rs:4661–4688  ·  view source on GitHub ↗
(
    ecx: &ExprContext,
    query: &Query<Aug>,
)

Source from the content-addressed store, hash-verified

4659}
4660
4661fn plan_array_subquery(
4662 ecx: &ExprContext,
4663 query: &Query<Aug>,
4664) -> Result<CoercibleScalarExpr, PlanError> {
4665 plan_vector_like_subquery(
4666 ecx,
4667 query,
4668 |elem_type| {
4669 matches!(
4670 elem_type,
4671 SqlScalarType::Char { .. }
4672 | SqlScalarType::Array { .. }
4673 | SqlScalarType::List { .. }
4674 | SqlScalarType::Map { .. }
4675 )
4676 },
4677 |elem_type| ArrayCreate { elem_type }.into(),
4678 |order_by| AggregateFunc::ArrayConcat { order_by },
4679 expr_func::ArrayArrayConcat.into(),
4680 |elem_type| {
4681 HirScalarExpr::literal(
4682 Datum::empty_array(),
4683 SqlScalarType::Array(Box::new(elem_type)),
4684 )
4685 },
4686 "[]",
4687 )
4688}
4689
4690/// Generic function used to plan both array subqueries and list subqueries
4691fn plan_vector_like_subquery<F1, F2, F3, F4>(

Callers 1

plan_expr_innerFunction · 0.85

Calls 2

ArrayClass · 0.85

Tested by

no test coverage detected