Return all distinct exprs in the grouping set. For `CUBE` and `ROLLUP` this is just the underlying list of exprs. For `GROUPING SET` we need to deduplicate the exprs in the underlying sets.
(&self)
| 1429 | /// is just the underlying list of exprs. For `GROUPING SET` we need to deduplicate |
| 1430 | /// the exprs in the underlying sets. |
| 1431 | pub fn distinct_expr(&self) -> Vec<&Expr> { |
| 1432 | match self { |
| 1433 | GroupingSet::Rollup(exprs) | GroupingSet::Cube(exprs) => { |
| 1434 | exprs.iter().collect() |
| 1435 | } |
| 1436 | GroupingSet::GroupingSets(groups) => { |
| 1437 | let mut exprs: Vec<&Expr> = vec![]; |
| 1438 | for exp in groups.iter().flatten() { |
| 1439 | if !exprs.contains(&exp) { |
| 1440 | exprs.push(exp); |
| 1441 | } |
| 1442 | } |
| 1443 | exprs |
| 1444 | } |
| 1445 | } |
| 1446 | } |
| 1447 | } |
| 1448 | |
| 1449 | /// A Lambda expression with a set of parameters names and a body |
no test coverage detected