static Expression trimAliases(Expression expr) {
        return expr.transformDown(e -> {
            if (e instanceof Alias) {
                return ((Alias) e).child;
            }
            return e;
        });
    }
This rule finds aggregate expressions that are not in an aggregate operator.  For example,
those in a HAVING clause or ORDER BY clause.  These expressions are pushed down to the
underlying aggregate operator and then projected away after the original operator.
indexr-query-opt/src/main/java/io/indexr/query/Analyzer.java