Humanize the column to a [`String`], returns an empty [`String`] for unknown columns (or columns named `UNKNOWN_COLUMN_NAME`).
(&self, humanizer: &dyn ExprHumanizer)
| 983 | /// Humanize the column to a [`String`], returns an empty [`String`] for |
| 984 | /// unknown columns (or columns named `UNKNOWN_COLUMN_NAME`). |
| 985 | pub fn humanize(&self, humanizer: &dyn ExprHumanizer) -> String { |
| 986 | match self { |
| 987 | Self::Global(id, c) => humanizer.humanize_column(*id, *c).unwrap_or_default(), |
| 988 | Self::Aggregate(func, expr) => { |
| 989 | let func = func.name(); |
| 990 | let expr = expr.humanize(humanizer); |
| 991 | if expr.is_empty() { |
| 992 | String::from(func) |
| 993 | } else { |
| 994 | format!("{func}_{expr}") |
| 995 | } |
| 996 | } |
| 997 | Self::Annotated(name) => name.to_string(), |
| 998 | Self::Unknown => String::new(), |
| 999 | } |
| 1000 | } |
| 1001 | |
| 1002 | /// Clone this column name if it is known, otherwise try to use the provided |
| 1003 | /// name if it is available. |
no test coverage detected