pub fn has_aggregate(e: &Expr) -> bool
Does this expression call an aggregate at ITS level — not inside a subquery, whose aggregates belong to the subquery?