Function mz_sql::plan::query::plan_rows_from_internal
source · fn plan_rows_from_internal<'a>(
qcx: &QueryContext<'_>,
functions: impl IntoIterator<Item = &'a Function<Aug>>,
table_name: Option<FullItemName>,
) -> Result<(HirRelationExpr, Scope, Vec<usize>), PlanError>
Expand description
Plans an expression coalescing multiple table functions. Each table function is followed by its row ordinality. The entire expression is followed by the coalesced row ordinality.
The returned Scope will set all item’s table_name’s to the table_name
parameter if it is Some
. If None
, they will be the name of each table
function.
The returned Vec<usize>
is the number of (non-ordinality) columns from
each table function.
For example, with table functions tf1 returning 1 column (a) and tf2 returning 2 columns (b, c), this function will return an expr 6 columns:
- tf1.a
- tf1.ordinality
- tf2.b
- tf2.c
- tf2.ordinality
- coalesced_ordinality
And a Vec<usize>
of [1, 2]
.