[Data]Improve table aggregate function#61418
Merged
alexeykudinkin merged 3 commits intoray-project:masterfrom Mar 12, 2026
Merged
[Data]Improve table aggregate function#61418alexeykudinkin merged 3 commits intoray-project:masterfrom
alexeykudinkin merged 3 commits intoray-project:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the group iteration logic in TableBlockAccessor._aggregate by replacing the manual row-by-row implementation with a call to the more efficient _iter_groups_sorted method. This change improves performance by leveraging a vectorized approach and simplifies the code. I have one minor suggestion to make the generator delegation more idiomatic.
Signed-off-by: yifan.xie <xyfabcd@163.com>
68f8b2c to
6a57c3c
Compare
Signed-off-by: yifan.xie <xyfabcd@163.com>
Contributor
Author
|
@bveeramani Could you help review this pr? thanks a lot. |
alexeykudinkin
approved these changes
Mar 12, 2026
Contributor
Author
|
@alexeykudinkin Thanks a lot. |
This file contains hidden or 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
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.
Description
The current implementation of iter_groups in aggregate determine the boundary of each key by iterating row by row when need to split all rows into multiple groups. That is expensive operation. #58910 provide the same functionality function, named _iter_groups_sorted. This function is more efficient than original.
To verify, i mock the following table.
The 'content' column is randomly generated.
The 'length' column is length of 'content' column.
And use the following script to test aggregate function performance.
The test result is:
Related issues
Additional information