Create a Column from the Scalar Expr
(
scalar_expr: &Expr,
subqry_alias: String,
)
| 175 | |
| 176 | /// Create a Column from the Scalar Expr |
| 177 | pub fn create_col_from_scalar_expr( |
| 178 | scalar_expr: &Expr, |
| 179 | subqry_alias: String, |
| 180 | ) -> Result<Column> { |
| 181 | match scalar_expr { |
| 182 | Expr::Alias(Alias { name, .. }) => Ok(Column::new( |
| 183 | Some::<TableReference>(subqry_alias.into()), |
| 184 | name, |
| 185 | )), |
| 186 | Expr::Column(col) => Ok(col.with_relation(subqry_alias.into())), |
| 187 | _ => { |
| 188 | let scalar_column = scalar_expr.schema_name().to_string(); |
| 189 | Ok(Column::new( |
| 190 | Some::<TableReference>(subqry_alias.into()), |
| 191 | scalar_column, |
| 192 | )) |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /// Recursively un-normalize all [`Column`] expressions in a list of expression trees |
| 198 | #[inline] |
no test coverage detected
searching dependent graphs…