Skip to content

Conversation

@original-brownbear
Copy link
Contributor

This interface is just implemented once, inline it into the abstract parent of all other implementations.

Sorry that the diff is a little hard to follow for the SingleBucketAggregation file because of the rename. I still figured it was cleaner to do the rename and inline in one go but happy to change that if it's hard to follow.
Hopefully it's ok because this is just a mechanical PR, but happy to do without the rename of the abstract class to the interface for a shorter PR.

This interface is just implemented once, inline it into the abstract parent of
all other implementations.
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 19, 2025
/**
* Results of the {@link ParentToChildrenAggregator}.
*/
public class InternalChildren extends InternalSingleBucketAggregation {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The motivation in cleaning this up shoud become visible here, all but one implementation of SingleBucketAggregation are noop overrides. We can (with a bit of BwC code for the transport layer) fold all of these into a single class and save both a lot of code but also make serialization a lot more compact (and faster!).

* A base class for all the single bucket aggregations.
*/
public interface SingleBucketAggregation extends Aggregation {
public class SingleBucketAggregation extends InternalAggregation {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making this a concrete class. For now, that only cleans up some testing and allows us to replace the mocks with actual instances. But going forward, we should be able to remove the various noop subclasses.

@original-brownbear original-brownbear closed this by deleting the head repository Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants