Module rewrite

Module rewrite 

Source

Structsยง

TableAliasRewriter
A TreeNodeRewriter implementation that rewrites Expr::Column expressions by replacing the columnโ€™s name with an alias if the column exists in the provided schema.

Functionsยง

find_projection ๐Ÿ”’
find_unnest_column_alias ๐Ÿ”’
Try to find the column alias for UNNEST in the inner projection. For example:
inject_column_aliases ๐Ÿ”’
Injects column aliases into the projection of a logical plan by wrapping expressions with Expr::Alias using the provided list of aliases.
inject_column_aliases_into_subquery ๐Ÿ”’
Injects column aliases into a subqueryโ€™s logical plan. The function searches for a Projection within the given plan, which may be wrapped by other operators (e.g., LIMIT, SORT). If the top-level plan is a Projection, it directly injects the column aliases. Otherwise, it iterates through the planโ€™s children to locate and transform the Projection.
normalize_union_schema ๐Ÿ”’
Normalize the schema of a union plan to remove qualifiers from the schema fields and sort expressions.
rewrite_plan_for_sort_on_non_projected_fields ๐Ÿ”’
Rewrite logic plan for query that order by columns are not in projections Plan before rewrite:
rewrite_qualify ๐Ÿ”’
Rewrite Filter plans that have a Window as their input by inserting a SubqueryAlias.
rewrite_sort_expr_for_union ๐Ÿ”’
Rewrite sort expressions that have a UNION plan as their input to remove the table reference.
subquery_alias_inner_query_and_columns ๐Ÿ”’
This logic is to work out the columns and inner query for SubqueryAlias plan for some types of subquery or unnest