Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Nov 7, 2022

This moves the bucket selector aggregation to the aggregations module and ports all of it's ESIntegTestCase tests to REST tests which gets us mixed cluster testing.

Relates to #26220
Relates to #90283

@nik9000 nik9000 added >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations v8.6.0 labels Nov 7, 2022
@nik9000 nik9000 requested a review from martijnvg November 7, 2022 14:47
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Nov 7, 2022
@elasticsearchmachine
Copy link
Collaborator

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

This moves the bucket selector aggregation to the aggregations module
and ports all of it's ESIntegTestCase tests to REST tests which gets us
mixed cluster testing.

Relates to elastic#26220
Relates to elastic#90283
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.

👍 assuming successful build

The change looks good. The PivotTests should be easy to fix. The namedXContentRegistry should also load bucket_selector xcontent classes. I don't yet understand RestSqlIT#testFetchAllPagesCompositeAggCursorWithFilterOnAggregate* failures. Maybe flaky test?

@nik9000
Copy link
Member Author

nik9000 commented Nov 7, 2022

The change looks good. The PivotTests should be easy to fix. The namedXContentRegistry should also load bucket_selector xcontent classes. I don't yet understand RestSqlIT#testFetchAllPagesCompositeAggCursorWithFilterOnAggregate* failures. Maybe flaky test?

I'll have a look. SQL uses bucket selector so it could be a real thing!

for (var agg : aggregation.getPipelineAggregations()) {
if (agg instanceof BucketSelectorPipelineAggregationBuilder) {
// Use type.equals because there are two copies of BucketSelectorPipelineAggregationBuilder on the classpath
if (agg.getType().equals(BucketSelectorPipelineAggregationBuilder.NAME)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@martijnvg, I think this is similar to the kinds of problems you'd had before. I'm not a fan of this solution, but it got the tests passing and we can talk about it here.

Copy link
Member

Choose a reason for hiding this comment

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

// Use type.equals because there are two copies of BucketSelectorPipelineAggregationBuilder on the classpath

With java modularisation, it shouldn't be possible to have two classes with the same package/name to be exported from different modules?

Copy link
Member Author

Choose a reason for hiding this comment

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

Plugins load them on different classloaders. I'm certainly doing something wrong here though.

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with this approach here, since for now there isn't an alternative.

@nik9000 nik9000 added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Nov 10, 2022
@elasticsearchmachine elasticsearchmachine merged commit 76bd44f into elastic:main Nov 10, 2022
@nik9000 nik9000 deleted the move_bucket_selector branch November 10, 2022 19:24
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!) Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants