-
Notifications
You must be signed in to change notification settings - Fork 21
GROUP BY CUBE / ROLLUP / GROUPING SETS #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ke (Total), (earlier), (other)
9da0cc6 to
4c1ce0a
Compare
|
Would fix #253 |
… NULL for subtotals
… refactor _select(), remove _compile_select_base() to move closer to the original logic before ROLLUP, CUBE, etc.
- In AST: Change 'sets' modifier to 'grouping sets' for consistency - Update AST structure to use GroupByElement for consistency with other language constructs - Update tests to reflect new structure
4c1ce0a to
16f7cee
Compare
|
Thanks for working on this. This would be a nice feature to have in beanquery. Although, there are a few issues with the PR. First, to make the PR more easily reviewable, the patches should be organized in logical commits, not in commits working a reworking the same code. In particular, Glancing at the code, I don't understand which problem the addition of the Finally, the use of |
|
Thank you for considering this! I will follow your review:
Remaining questions
|
This implements the SQL GROUP BY modifiers
CUBE,ROLLUP, andGROUPING SETS, which allow to add subtotals to the output. For me, this is very useful to produce, for example monthly reports of income vs. expenses, where the row(Total)tells me the net gain/loss of the month:What do you think of this?