Function mz_sql::plan::query::plan_function_order_by
source · fn plan_function_order_by(
ecx: &ExprContext<'_>,
order_by: &[OrderByExpr<Aug>],
) -> Result<(Vec<HirScalarExpr>, Vec<ColumnOrder>), PlanError>
Expand description
Plans the ORDER BY clause of a window function.
Unfortunately, we have to create two HIR structs from an AST OrderByExpr:
A ColumnOrder has asc/desc and nulls first/last, but can’t represent an HirScalarExpr, just
a column reference by index. Therefore, we return both HirScalarExprs and ColumnOrders.
Note that the column references in the ColumnOrders point NOT to input columns, but into the
Vec<HirScalarExpr>
that we return.