Rebuilds an `Expr` with columns that refer to aliases replaced by the alias' underlying `Expr`.
(
expr: Expr,
aliases: &HashMap<String, Expr>,
)
| 235 | /// Rebuilds an `Expr` with columns that refer to aliases replaced by the |
| 236 | /// alias' underlying `Expr`. |
| 237 | pub(crate) fn resolve_aliases_to_exprs( |
| 238 | expr: Expr, |
| 239 | aliases: &HashMap<String, Expr>, |
| 240 | ) -> Result<Expr> { |
| 241 | expr.transform_up(|nested_expr| match nested_expr { |
| 242 | Expr::Column(c) if c.relation.is_none() => { |
| 243 | if let Some(aliased_expr) = aliases.get(&c.name) { |
| 244 | Ok(Transformed::yes(aliased_expr.clone())) |
| 245 | } else { |
| 246 | Ok(Transformed::no(Expr::Column(c))) |
| 247 | } |
| 248 | } |
| 249 | _ => Ok(Transformed::no(nested_expr)), |
| 250 | }) |
| 251 | .data() |
| 252 | } |
| 253 | |
| 254 | /// Given a slice of window expressions sharing the same sort key, find their common partition |
| 255 | /// keys. |
no test coverage detected
searching dependent graphs…