Skip to content

RC - Grouping Sets, rollup, cube. #1377 - #1667

Merged
mattdowle merged 2 commits into
masterfrom
groupingsets
Aug 7, 2017
Merged

mattdowle merged 2 commits into
masterfrom
groupingsets

Conversation

@jangorecki

@jangorecki jangorecki commented Apr 21, 2016 •

Copy link
Copy Markdown
Member

rebased to 1.10.1

Working solution to solve #1377 on R side. It rbind results from multiple aggregation calls. Surely not as efficient as if it would be pushed to C. Still not trivial to achieve for end-users.

This PR contains:

  • 3 generic methods for rollup, cube, grouping sets
  • methods for data.table
  • optionally generates aggregation levels as grouping id (bit mask), crucial for better consumption of the data and navigation over aggregates.
  • unit tests vs. postgres grouping sets queries matched successfully (not included in source due to heavy dependency).

Additionally handled in second iteration:

  • define tests
  • check edge cases
  • detection if .SD was used in j, then set default .SDcols, currently provided .SD and no .SDcols is not well handled
  • replace bitwAnd function call with something that works on R 2.15.0
  • use verbose argument in some useful way
  • forbid := calls
  • double counting on duplicated sets passed to groupingsets function should raise warning
  • detect duplicated columns within single grouping - error
  • col used both in by and j raise error
  • workaround for integer64 issue on rbindlist(fill=TRUE) Integer64 columns not assigned NA when doing a left merge #1459
  • unit tests proper handling of factors on 2.15.0

Extra TODO (won't be included in source):

  • test edge cases against postgres and compare match to data.table
  • check bigger volumes vs. postgres

  • Add info to NEWS.md!

Improvements:

  • handle same sets of columns but in different order, now it force order and warn on double counting

@jangorecki jangorecki changed the title [WIP] address #1377 on R side [WIP] address Grouping Sets #1377 Apr 21, 2016
@jangorecki jangorecki changed the title [WIP] address Grouping Sets #1377 [WIP] RC - Grouping Sets, rollup, cube. #1377 Apr 23, 2016
@jangorecki jangorecki changed the title [WIP] RC - Grouping Sets, rollup, cube. #1377 RC - Grouping Sets, rollup, cube. #1377 Apr 24, 2016
@mshiner

mshiner commented May 3, 2016

Copy link
Copy Markdown

I'd be very interested to see this implemented in data.table as I'm hoping to use it as part of a reporting front end for the open source ERP system https://github.com/uzerpllp/uzerp we develop

@jangorecki

Copy link
Copy Markdown
Member Author

possible speed up after #1892

@codecov-io

codecov-io commented Dec 21, 2016 •

Copy link
Copy Markdown

Codecov Report

Merging #1667 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
+ Coverage   90.81%   90.97%   +0.16%     
==========================================
  Files          59       60       +1     
  Lines       11655    11745      +90     
==========================================
+ Hits        10584    10685     +101     
+ Misses       1071     1060      -11
Impacted Files Coverage Δ
R/groupingsets.R 100% <100%> (ø)
src/forder.c 94.47% <0%> (+0.52%) ⬆️
src/bmerge.c 96.92% <0%> (+1.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update caea962...73c98fd. Read the comment docs.

@mattdowle
mattdowle merged commit 1bc0553 into master Aug 7, 2017
@mattdowle
mattdowle deleted the groupingsets branch August 7, 2017 22:52
@mattdowle mattdowle added this to the v1.10.6 milestone Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants