MCPcopy Create free account
hub / github.com/apache/datafusion / rewrite_sort_expr_for_union

Function rewrite_sort_expr_for_union

datafusion/sql/src/unparser/rewrite.rs:86–101  ·  view source on GitHub ↗

Rewrite sort expressions that have a UNION plan as their input to remove the table reference.

(exprs: Vec<SortExpr>)

Source from the content-addressed store, hash-verified

84
85/// Rewrite sort expressions that have a UNION plan as their input to remove the table reference.
86fn rewrite_sort_expr_for_union(exprs: Vec<SortExpr>) -> Result<Vec<SortExpr>> {
87 let sort_exprs = exprs
88 .map_elements(&mut |expr: Expr| {
89 expr.transform_up(|expr| {
90 if let Expr::Column(mut col) = expr {
91 col.relation = None;
92 Ok(Transformed::yes(Expr::Column(col)))
93 } else {
94 Ok(Transformed::no(expr))
95 }
96 })
97 })
98 .data()?;
99
100 Ok(sort_exprs)
101}
102
103/// Rewrite Filter plans that have a Window as their input by inserting a SubqueryAlias.
104///

Callers 1

normalize_union_schemaFunction · 0.85

Calls 4

transform_upMethod · 0.80
ColumnClass · 0.50
dataMethod · 0.45
map_elementsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…