Refactor cagg bucket alignment code - #9729
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
gayyappan
approved these changes
May 8, 2026
gayyappan
left a comment
Member
There was a problem hiding this comment.
Nice cleanup of the code. A lot more readable now.
some minor comments.
| @@ -155,12 +155,24 @@ get_largest_bucketed_window(Oid timetype, int64 bucket_width) | |||
| */ | |||
| static InternalTimeRange | |||
| compute_inscribed_bucketed_refresh_window(const ContinuousAgg *cagg, | |||
Member
There was a problem hiding this comment.
Not sure about the change in the parameters here:
either use cagg->bucket_function.
Or remove cagg from the parameters?
Member
Author
There was a problem hiding this comment.
Yes I added bucket_function to replace bucket_width, but didn't realize cagg is there for the same purpose. I will remove cagg.
Member
Author
Thank you! |
Refactor the bucket alignment code to reduce duplication - Extract the logics that computes the bucket start and next bucket start into corresponding functions to use at a few places - Consolidate functions that compute bucket start for both fix and variable bucket. - Clean up the inscribe/circumscribe functions
pnthao
force-pushed
the
refactor_cagg_bucket_alignment_code
branch
from
May 8, 2026 15:19
6f0da79 to
da3e892
Compare
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.
Refactor the bucket alignment code
Refactor the bucket alignment code to reduce duplication
- Extract the logics that computes the bucket start and next bucket
start into corresponding functions to use at a few places
- Consolidate functions that compute bucket start for both fix and
variable bucket.
- Clean up the inscribe/circumscribe functions
Disable-check: force-changelog-file