rails / arel

A Relational Algebra
2.06k stars 390 forks source link

PG: Add Support for GroupBy's Cube, Rollup and Grouping Set #432

Closed MohammadHabbab closed 8 years ago

MohammadHabbab commented 8 years ago

This Adds support for new syntax added to PG 9.5, namely, CUBE, ROLLUP and GROUPING SET by augmenting PostgreSQL's Visitor with the appropriate unary nodes.

An additional node type GroupingElement has been added as a unary node to allow forcing parenthesis grouping for other syntactic nodes parameters, since parenthesis are significant for CUBE, ROLLUP and GROUPING SET semantics.

rails-bot commented 8 years ago

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

akarzim commented 7 years ago

I think the correct semantic is GROUPING SETS (with a final S) regarding to the documentation: https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.5#GROUPING_SETS.2C_CUBE_and_ROLLUP

Or have I misunderstood something ?

md5 commented 6 years ago

@akarzim You're correct