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

Function plan_nested_query

src/sql/src/plan/query.rs:1796–1825  ·  view source on GitHub ↗
(
    qcx: &mut QueryContext,
    q: &Query<Aug>,
)

Source from the content-addressed store, hash-verified

1794}
1795
1796pub fn plan_nested_query(
1797 qcx: &mut QueryContext,
1798 q: &Query<Aug>,
1799) -> Result<(HirRelationExpr, Scope), PlanError> {
1800 let PlannedQuery {
1801 mut expr,
1802 scope,
1803 order_by,
1804 limit,
1805 offset,
1806 project,
1807 group_size_hints,
1808 } = qcx.checked_recur_mut(|qcx| plan_query(qcx, q))?;
1809 if limit.is_some()
1810 || !offset
1811 .clone()
1812 .try_into_literal_int64()
1813 .is_ok_and(|offset| offset == 0)
1814 {
1815 expr = HirRelationExpr::top_k(
1816 expr,
1817 vec![],
1818 order_by,
1819 limit,
1820 offset,
1821 group_size_hints.limit_input_group_size,
1822 );
1823 }
1824 Ok((expr.project(project), scope))
1825}
1826
1827fn plan_set_expr(
1828 qcx: &mut QueryContext,

Callers 9

plan_insert_queryFunction · 0.85
plan_ctesFunction · 0.85
plan_set_exprFunction · 0.85
plan_table_factorFunction · 0.85
inventFunction · 0.85
plan_existsFunction · 0.85
plan_subqueryFunction · 0.85
plan_hirMethod · 0.85

Calls 6

plan_queryFunction · 0.85
checked_recur_mutMethod · 0.80
is_someMethod · 0.80
cloneMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected