-
Notifications
You must be signed in to change notification settings - Fork 3.9k
chore(engine): implement range aggregation operator #17997
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
| isTSInRange = func(t time.Time) bool { | ||
| // Aggregate entries that belong in [earliestTs, evalTs) | ||
| return t.Compare(earliestTs) >= 0 && t.Compare(evalTs) < 0 | ||
| } |
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.
nit: You could create a helper struct like bloomshipper.Interval that has a Compare(t time.Time) method
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.
👍 we can add something like this when we add support for range queries
| } | ||
| tsCol := vec.ToArray().(*array.Timestamp) | ||
|
|
||
| for row := range int(record.NumRows()) { |
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.
If the records where sorted by timestamp we could use binary search to determine start/end index 😑
What this PR does / why we need it:
First version of range aggregation operator that only support count function for instant queries. It is implemented using a hash aggregation
I have left multiple TODOs but most of them are not immediate concerns.
Being able to return partial aggregate results on each Read call is something I'll look into in a follow-up PR.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.mddeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR