-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Histogram Aggregation Function #1406
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
Conversation
Mytherin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks exquisite. Some minor comments:
| if (!state->hist) { | ||
| state->hist = new map<T, size_t>(); | ||
| } | ||
| T value = input.GetValue(i).GetValue<T>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to use the underlying array directly (i.e. auto input_data = (T *) input_data.data;) instead of the much slower value interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I guess I'll have to write a specialized method for strings then
|
Looks great, I have a suggestion: Instead of naming the map entries |
|
@hannesmuehleisen I don't have a strong opposition to that, the reason I went for k and v was to not make the answer super large would be As a comparison, Presto would output: |
|
@pdet i think self-describing names are better, since this only affects the ToString representation. |
|
Thanks! |
I'm using map, since I guess that's preferred over unordered_map?