Skip to content
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

Aggregations on Range Fields #34644

Closed
6 of 11 tasks
polyfractal opened this issue Oct 19, 2018 · 7 comments
Closed
6 of 11 tasks

Aggregations on Range Fields #34644

polyfractal opened this issue Oct 19, 2018 · 7 comments
Assignees
Labels
:Analytics/Aggregations Aggregations >enhancement Meta Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@polyfractal
Copy link
Contributor

polyfractal commented Oct 19, 2018

Meta-issue to encompass adding aggregation support for Range fields (date, numeric and IP).

Pre-work todo:

  • Document that aggs do not currently work with range fields

Common aggregations:

Date Specific:

IP Specific:

  • IP Range

Considerations

Dealing with ranges opens up some interesting usability issues. For example, min/max could deal with either the start or the end of the range. Similarly, for bucketing aggs like histogram and range, we may need to support "relations" such as contains, intersect, etc.

Related issues:

Use Cases:

#37642 - Weighting data across buckets

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@chrisbeckc1
Copy link

getting this feature would be significant in making use of the datasets we are creating. is there any traction?

@polyfractal
Copy link
Contributor Author

@chrisbeckc1 we're internally talking about how to implement this, but we don't have any concrete roadmap/timeline yet (and we generally don't state public timelines anyway since features can slip... we don't want to get people prematurely excited on accident).

It is under active consideration and development though, so once we start making progress we'll update this meta issue with links to PRs, etc. :)

@rejj
Copy link

rejj commented Jan 3, 2019

Can someone please at least do the "Pre-work" and make a quick update to the documentation with a warning that aggs don't work with range fields? This has just bitten me - date range seemed perfect for a document that has start date and end date values, but now I cannot aggregate on the minimum start date for example.

@foreman3
Copy link

This would be very useful for many of our use cases, which involve generating metrics on "active" records, which have a start and end date. A date_range_histogram would be great.

@not-napoleon
Copy link
Member

I've taken min and max off the to-do list; After discussion we've decided not to include them at this time. There's no natural ordering for ranges, so we can't rely on the existing min & max aggregation API; if we were to include min & max, we'd need to add a new API allowing users to specify the ordering for the ranges. We don't have a use case specifically in mind for min & max on ranges, so expanding the API like that doesn't seem justified. If there's a specific use case for min & max aggregations over ranges in the future, we can revisit that choice.

@polyfractal polyfractal removed the 7x label Dec 12, 2019
@rjernst rjernst added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 4, 2020
@polyfractal
Copy link
Contributor Author

Closing as we're done with our initial set of range aggs, and don't have plans for more range-based aggs in the near future. Any future additions/enhancements can be dealt with on a per-agg basis, no need for this meta anymore 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement Meta Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

8 participants