Returns mapping of each alias (`String`) to the expression (`Expr`) it is aliasing.
(exprs: &[Expr])
| 193 | /// Returns mapping of each alias (`String`) to the expression (`Expr`) it is |
| 194 | /// aliasing. |
| 195 | pub(crate) fn extract_aliases(exprs: &[Expr]) -> HashMap<String, Expr> { |
| 196 | exprs |
| 197 | .iter() |
| 198 | .filter_map(|expr| match expr { |
| 199 | Expr::Alias(Alias { expr, name, .. }) => Some((name.clone(), *expr.clone())), |
| 200 | _ => None, |
| 201 | }) |
| 202 | .collect::<HashMap<String, Expr>>() |
| 203 | } |
| 204 | |
| 205 | /// Given an expression that's literal int encoding position, lookup the corresponding expression |
| 206 | /// in the select_exprs list, if the index is within the bounds and it is indeed a position literal, |
no test coverage detected
searching dependent graphs…