You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LocustDB currently doesn't support explicit GROUP BY clauses, and instead implicitly performs GROUP BY of any non-aggregation expression if your query contains an aggregation expression. So e.g. SELECT COUNT(1), page, date FROM pageviews is implicitly transformed into SELECT COUNT(1), page, date FROM pageviews GROUP BY page, date. There's no fundamental reason for this other than that it seemed more elegant and I didn't want to type redundant GROUP BY clauses. I think it would be a good idea to allow normal GROUP BY clauses and perhaps even disallow the (non-standard) shorthand. The hard part here is checking that the GROUP BY clause is compatible with the projections and different databases seem to vary in the level of cleverness supported for this. As a first step, LocustDB should support GROUP BY clauses expressions where corresponding SELECT expressions are completely identical.
A more expressive version would also allow projections to be functions of the GROUP BY columns, e.g. queries like SELECT COUNT(1), page, SUBSTRING(date, 0, 4) FROM pageviews GROUP BY page, date.
The text was updated successfully, but these errors were encountered:
LocustDB currently doesn't support explicit GROUP BY clauses, and instead implicitly performs GROUP BY of any non-aggregation expression if your query contains an aggregation expression. So e.g.
SELECT COUNT(1), page, date FROM pageviews
is implicitly transformed intoSELECT COUNT(1), page, date FROM pageviews GROUP BY page, date
. There's no fundamental reason for this other than that it seemed more elegant and I didn't want to type redundantGROUP BY
clauses. I think it would be a good idea to allow normalGROUP BY
clauses and perhaps even disallow the (non-standard) shorthand. The hard part here is checking that theGROUP BY
clause is compatible with the projections and different databases seem to vary in the level of cleverness supported for this. As a first step, LocustDB should supportGROUP BY
clauses expressions where correspondingSELECT
expressions are completely identical.A more expressive version would also allow projections to be functions of the
GROUP BY
columns, e.g. queries likeSELECT COUNT(1), page, SUBSTRING(date, 0, 4) FROM pageviews GROUP BY page, date
.The text was updated successfully, but these errors were encountered: