-
Notifications
You must be signed in to change notification settings - Fork 7k
[data] Add TopK aggregator #59556
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?
[data] Add TopK aggregator #59556
Conversation
* Add TopKUnique aggregator that computes most frequent k values Signed-off-by: cem <[email protected]>
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.
Code Review
This pull request introduces a new TopKUnique aggregator, which is a valuable addition for computing the most frequent unique values in a column. The implementation correctly builds upon the existing ValueCounter and utilizes heapq.nlargest for efficient top-k computation. The accompanying tests are thorough, covering basic functionality, global frequency aggregation across blocks, and various edge cases. I have a couple of suggestions for a minor code cleanup to improve readability and a recommendation to enhance test robustness by adding a case for frequency ties.
|
Why is it called |
Yeah TopK would be better; will rename. |
* rename aggregator name * rename default alias name Signed-off-by: cem <[email protected]>
047ae0e to
c322ab8
Compare
Signed-off-by: cem <[email protected]>
Signed-off-by: cem <[email protected]>
Description
Add TopKUnique aggregator that computes most frequent k values