Introduce a new aggregation module#90294
Conversation
and moves the `adjacency_matrix` to this new module. The new module name is `aggregations`. The new module will use the `org.elasticsearch.aggregations.bucket` package for all bucket aggregations. (`org.elasticsearch.searcg.aggregations.bucket` is already taken by server module). Relates to elastic#90283
|
Opening this PR as draft in order for this change to pass PR CI. Probably some issues will occur, that I didn't foresee locally. |
| @@ -138,7 +137,6 @@ public class AggregationsTests extends ESTestCase { | |||
| new InternalDateRangeTests(), | |||
There was a problem hiding this comment.
I think we want this test also in the new module? As we move over aggregations we remove entries here and add it to the equivalent test case in aggregations module?
There was a problem hiding this comment.
How do we think this should look in the end? Would there be an AggregationsTests in test:framework that has no aggs listed? That feels maybe not great. But neither does having test:framework depend on the module. Maybe it'd make sense to move this class to a aggregations:test module that other aggregation extensions depend on. That'd pick up all these tests.
There was a problem hiding this comment.
But in the short term removing this from the list is fine.
There was a problem hiding this comment.
Maybe it'd make sense to move this class to a aggregations:test module that other aggregation extensions depend on. That'd pick up all these tests.
Yes, I think when enough tests (50%?) have moved we should move this test to the aggregation module.
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
| requires org.elasticsearch.base; | ||
| requires org.elasticsearch.server; | ||
| requires org.elasticsearch.xcontent; | ||
| requires org.apache.logging.log4j; |
There was a problem hiding this comment.
We might should just use ES's logging directly while we're moving.
| } | ||
|
|
||
| public static boolean hasValue(InternalAdjacencyMatrix agg) { | ||
| public static boolean hasValue(MultiBucketsAggregation agg) { |
There was a problem hiding this comment.
I've never really understood the point of this method. It seems like we could assert this in the tests if we wanted.
There was a problem hiding this comment.
Right, this is used in tests (GeoGridAggregatorTestCase) and sql (MetricAggExtractor). I think this should be moved to sql (looks like the biggest user of this class?) and the one usage in GeoGridAggregatorTestCase can be replaced with adding a helper method that does agg.getBuckets().stream().anyMatch(bucket -> bucket.getDocCount() > 0).
Let's do this in a followup change?
| @@ -138,7 +137,6 @@ public class AggregationsTests extends ESTestCase { | |||
| new InternalDateRangeTests(), | |||
There was a problem hiding this comment.
How do we think this should look in the end? Would there be an AggregationsTests in test:framework that has no aggs listed? That feels maybe not great. But neither does having test:framework depend on the module. Maybe it'd make sense to move this class to a aggregations:test module that other aggregation extensions depend on. That'd pick up all these tests.
| @@ -138,7 +137,6 @@ public class AggregationsTests extends ESTestCase { | |||
| new InternalDateRangeTests(), | |||
There was a problem hiding this comment.
But in the short term removing this from the list is fine.
|
|
||
| testClusters.configureEach { | ||
| module ':modules:mapper-extras' | ||
| module ':modules:aggregations' |
There was a problem hiding this comment.
I think this should be "temporary" - as in, when we've moved the rest of the aggs it should be removed.
Also this PR moves the
adjacency_matrixto this new module.This serves as an example how to move the other aggregations from the server module into this new module for aggregations.
The new module name is
aggregations.The new module will use the
org.elasticsearch.aggregations.bucketpackage for all bucket aggregations. (org.elasticsearch.search.aggregations.bucketis already taken by server module).We can change the naming as part of reviewing this PR.
Relates to #90283