-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ES|QL] Add support for counters to First/LastOverTime #135676
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
[ES|QL] Add support for counters to First/LastOverTime #135676
Conversation
This commit adds support for running FirstOverTime and LastOverTime on counter fields (counter_long, counter_integer, counter_double). The return value is the non-counter variation. For example, the following is a valid query and will return a double: ``` TS my_tsdb | STATS max(first_over_time(my_counter_double_field)) BY my_dimension, bucket(@timestamp, 10minute) ```
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
|
Are we sure we want over_time to work with counter fields? We have intentionally restricted counter fields to only rate and explicit casting. |
|
I think we do, to support something like: |
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.
I am on the fence about adding this support, but if Kostas needs it, I am okay with it. LGTM, thanks Larisa!
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/LastOverTime.java
Outdated
Show resolved
Hide resolved
|
This build was successful, just status not reported, so I am merging this |
This commit adds support for running FirstOverTime and LastOverTime on counter fields (counter_long, counter_integer, counter_double).
The return value is the non-counter variation.
For example, the following is a valid query and will return a double: