Skip to content

Conversation

@martijnvg
Copy link
Member

@martijnvg martijnvg commented Oct 10, 2022

This change also moves adjacency_matrix aggregation to its own package.

Note that that this PR also moves test code not related to auto date histogram.
I think this is cleaner then leaving some tests in a non desired state between PRs.
Also the test code that has been moved is slatted for being moved to the aggregations module.
I suspect that future changes, like for example moving terms agg, require that other aggregations
to be moved as well (e.g. significant_terms), since a lot of code is reused as well.

Relates to #90283

}
}

// TODO: maybe add base class that overwrites nodePlugins(...) for all tests that will be added to this module.
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 will add base test classes in a followup change, so that we will not have to add AggregationsPlugin to each test class to will exist in this module.

*/

package org.elasticsearch.search.aggregations.bucket.histogram;
package org.elasticsearch.search.aggregations.bucket;
Copy link
Member Author

Choose a reason for hiding this comment

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

This test base class can be moved to aggregations module when data histogram has been moved to aggregations module as well. For now test framework is convenient because data histogram lives in server and auto date histogram in aggregations module.

new InternalGeoCentroidTests(),
new InternalHistogramTests(),
new InternalDateHistogramTests(),
new InternalAutoDateHistogramTests(),
Copy link
Member Author

Choose a reason for hiding this comment

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

See #90294 (comment) for reasoning of removal for now.

*/

package org.elasticsearch.search.aggregations.pipeline;
package org.elasticsearch.aggregations.pipeline;
Copy link
Member Author

Choose a reason for hiding this comment

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

The pipeline tests moved in this PR use PipelineAggregationHelperTests, which randomly use the auto date histogram aggregator. I could have temporarily removed the usage of this aggregator, but it felt better to already move these pipeline aggregator tests to the aggregation module, since this is where the pipeline aggregators that these tests are testing will reside after these have been moved.

*/

package org.elasticsearch.search.aggregations.pipeline;
package org.elasticsearch.aggregations.pipeline;
Copy link
Member Author

@martijnvg martijnvg Oct 10, 2022

Choose a reason for hiding this comment

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

This java integration test is also using: PipelineAggregationHelperTests. So I already moved this integration test to the aggregations module, for the same reason why the other pipeline unit tests were moved.

@martijnvg martijnvg marked this pull request as ready for review October 10, 2022 08:44
@martijnvg martijnvg changed the title Move auto data histogram to aggregations module Move auto date histogram to aggregations module Oct 10, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 10, 2022
@elasticsearchmachine
Copy link
Collaborator

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

*/

package org.elasticsearch.aggregations.bucket;
package org.elasticsearch.aggregations.bucket.adjacency;
Copy link
Member

Choose a reason for hiding this comment

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

At one point we were actually trying to reduce the number of packages. I'm not 100% sure why - they don't make a big difference to me either way. I guess I'd prefer they all be in a aggregation.bucket package or something.

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 guess I'd prefer they all be in a aggregation.bucket package or something.

This is what I prefer too, but then I realise it can become a bit messy too. When we move aggregations like term agg that have many helper classes the list of classes the in the bucket package can become overwhelming. Some of these classes due to their name are sorted in a place not close to the actual builder, factory and aggregator classes. Maybe we should change the names of these classes or turn these classes into inner classes? I'm not sure, but then the PRs that move aggregators to the aggregation module also do renames. Maybe we can assess this later and if we decide we want less packages then make these changes in separate PRs?

Note that some packages already share multiple aggregators. Like the histogram or terms package.

At one point we were actually trying to reduce the number of packages.

That is true, but the way I remember this was, avoiding packages to have with just a small number of classes. For example a package with 3 classes or less, is something we should avoid. Most of these aggregator packages have more classes. Enough imo that having its own package is okay.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. Let's keep going then.

@martijnvg martijnvg added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 12, 2022
@elasticsearchmachine elasticsearchmachine merged commit 03054d0 into elastic:main Oct 12, 2022
@martijnvg martijnvg deleted the move_auto-data-histogram_to_aggregations_module branch October 12, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants