Skip to content

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 21, 2022

The nested and reverse nested aggs use hppc maps and lists for mapping buckets to
ordinals. This commit converts these to use HashMaps and ArrayLists.

relates #84735

The nested and reverse nested aggs use hppc maps and lists for mapping buckets to
ordinals. This commit converts these to use HashMaps and ArrayLists.

relates elastic#84735
@rjernst rjernst requested a review from martijnvg April 21, 2022 14:29
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 21, 2022
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one question. Otherwise LGTM 👍

collectBucket(sub, childDocId, buffer[i]);
}
final int docId = childDocId;
bucketBuffer.stream().mapToLong(Long::longValue).forEach(bucket -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a regular for loop here? I notice that we have been avoiding to use steam() in hot code paths. I think we should do this here too? But Maybe I'm wrong here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had done the stream because I was trying to avoid materializing a primitive array. But I realized now I could just iterate over the boxed values and let java do the auto unboxing on the call to collectBucket.

@rjernst rjernst mentioned this pull request Apr 21, 2022
43 tasks
@rjernst rjernst merged commit 91b5272 into elastic:master Apr 21, 2022
@rjernst rjernst deleted the hppc/aggs branch April 21, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >refactoring Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants