This is a nice idea, especially given all the work people have done recently to make in-language querying nicer (Spark comes to mind). My only gripe is the 'auto-generated' column names for aggregates. This seems like a recipe for disaster - what if there is already (as there almost certainly will be) named "sum_gross_cost"? The behavior also just seems rather unexpected and implicit. My suggestion would be simple sy…
For what it's worth, a similar problem already exists with SQL. Something simple like
select count(*) from my_table;
automatically aliases the column to `count`, even if `my_table` has a column called `count`.In practice, I don't think this is a major problem.