-
Notifications
You must be signed in to change notification settings - Fork 25
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
Aggregations, Windowing and Distinct - in-memory #46
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
+ Coverage 95.25% 95.87% +0.61%
==========================================
Files 9 10 +1
Lines 864 1018 +154
==========================================
+ Hits 823 976 +153
- Misses 41 42 +1
Continue to review full report at Codecov.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New functionalities:
GROUP BY
clause: allow specifying aggregation groupsSELECT DISTINCT
: filters out duplicate rowsSELECT PARTIALS
: outputs partial/intermediate results of aggregates for each input row (instead of only outputting the totals - default behaviour). This emulates window functions where the window is always the input data on its original order, partitioned using the GROUP BY criteria--unbuffered
command-line argument to allow users to disable output buffering (useful, for instance, when runningSELECT PARTIALS
over streaming data)This is an in-memory implementation for providing basic aggregation functionality. The following limitations require follow-up reimplementations:
GROUP BY
: groups are stored into memory: when calculating sums, counts, averages, etc, over a reasonable number of groups this is not a problem. Memory consumption might be too large when the number of groups is very largearray_agg
: this aggregate function collects all elements into memorySELECT DISTINCT
,set_agg
,count_disintct_agg
: these operations store all unique values into memorySELECT max_agg(x) if x>0 else 0, count_agg(*)
produces unpredictable results because in some rows themax_agg
function is executed and in others is not. Therefore, in some rows thecount_agg
will be the second to be called and on others would be the first, mixing up cumulative values.An alternative approach should be discussed, either for this PR or for a follow-up reimplementation.
Closes #44 .
Closes #45 .