Skip to content

added cumulative sum reducer function for terms aggregations and added tests for cumulative sum aggregator #46225#95199

Closed
timothy-choi wants to merge 0 commit intoelastic:mainfrom
timothy-choi:main
Closed

added cumulative sum reducer function for terms aggregations and added tests for cumulative sum aggregator #46225#95199
timothy-choi wants to merge 0 commit intoelastic:mainfrom
timothy-choi:main

Conversation

@timothy-choi
Copy link
Copy Markdown

@timothy-choi timothy-choi commented Apr 12, 2023

Here is my attempt to add a cumulative sum aggregation to a bucket that is a terms aggregation for issue #46225. I created another reducer function called 'reducerTermsAgg' that retrieves all the buckets of a terms aggregation and iterates through each bucket to calculate the sum of all the entries in the bucket and saving them in a map. I also created a helper function that takes that map and creates an aggregation that contains all sums of each bucket for each value type. The value types I used where Double, Long, and String.

I also added unit tests for this implementation. These tests cover whether the cumulative sum aggregation works on String, Double, and Long types, as well whether it works with no buckets provided and if it can also correctly find the total _count of each bucket.

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v8.8.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Apr 12, 2023
@HiDAl HiDAl added :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team and removed needs:triage Requires assignment of a team area label labels Apr 17, 2023
@HiDAl
Copy link
Copy Markdown

HiDAl commented Apr 17, 2023

assigning the ticket to the right team

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

@cbuescher cbuescher added :Analytics/Aggregations Aggregations and removed :Search/Search Search-related issues that do not fall into other categories labels Apr 17, 2023
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed Team:Search Meta label for search team labels Apr 17, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@cbuescher
Copy link
Copy Markdown
Member

Moving to the Analytics team since this PR adds a new pipeline aggregation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants