Tests for runtime field queries with fbf aggs#71503
Merged
nik9000 merged 6 commits intoelastic:masterfrom Apr 12, 2021
Merged
Conversation
This adds a few tests for runtime field queries applied to "filter-by-filter" style aggregations. We expect to still be able to use filter-by-filter aggregations to speed up collection when the top level query is a runtime field. You'd think that filter-by-filter would be slow when the top level query is slow, like it is with runtime fields, but we only run filter-by-filter when we can translate each aggregation bucket into a quick query. So long as the results of those queries don't "overlap" we shouldn't end up running the slower top level query more times than we would during regular collection. This also adds some javadoc to that effect to the two places where we chose between filter-by-filter and a "native" aggregation implementation.
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
nik9000
commented
Apr 8, 2021
| segmentsCollected++; | ||
| collectCount(ctx, live); | ||
| } else { | ||
| segmentsCounted++; |
Member
Author
There was a problem hiding this comment.
These were missing! Ooops.
not-napoleon
approved these changes
Apr 12, 2021
| } | ||
| }; | ||
| Query query = new StringScriptFieldTermQuery(new Script("dummy"), scriptFactory, "dummy", "cat", false); | ||
| debugTestCase(new RangeAggregationBuilder("r").field(NUMBER_FIELD_NAME).addRange(0, 1).addRange(1, 2).addRange(2, 3), query, iw -> { |
Member
There was a problem hiding this comment.
Nit - I think the formatting here isn't following the new standard; Can you just run the auto-formatter on this, please?
Member
Author
There was a problem hiding this comment.
Surprisingly, this is what the standard looks like. If I had to guess the lambdas are letting this bunch up somehow.
Member
There was a problem hiding this comment.
I stand corrected. Thanks for checking!
| * {@link Aggregator} per leaf and perform partial reductions. It always | ||
| * creates a single {@link Aggregator} so we can get consistent debug info. | ||
| */ | ||
| protected <R extends InternalAggregation> void debugTestCase( |
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Apr 12, 2021
This adds a few tests for runtime field queries applied to "filter-by-filter" style aggregations. We expect to still be able to use filter-by-filter aggregations to speed up collection when the top level query is a runtime field. You'd think that filter-by-filter would be slow when the top level query is slow, like it is with runtime fields, but we only run filter-by-filter when we can translate each aggregation bucket into a quick query. So long as the results of those queries don't "overlap" we shouldn't end up running the slower top level query more times than we would during regular collection. This also adds some javadoc to that effect to the two places where we chose between filter-by-filter and a "native" aggregation implementation.
nik9000
added a commit
that referenced
this pull request
Apr 12, 2021
…71585) This adds a few tests for runtime field queries applied to "filter-by-filter" style aggregations. We expect to still be able to use filter-by-filter aggregations to speed up collection when the top level query is a runtime field. You'd think that filter-by-filter would be slow when the top level query is slow, like it is with runtime fields, but we only run filter-by-filter when we can translate each aggregation bucket into a quick query. So long as the results of those queries don't "overlap" we shouldn't end up running the slower top level query more times than we would during regular collection. This also adds some javadoc to that effect to the two places where we chose between filter-by-filter and a "native" aggregation implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a few tests for runtime field queries applied to
"filter-by-filter" style aggregations. We expect to still be able to
use filter-by-filter aggregations to speed up collection when the top
level query is a runtime field. You'd think that filter-by-filter would
be slow when the top level query is slow, like it is with runtime
fields, but we only run filter-by-filter when we can translate each
aggregation bucket into a quick query. So long as the results of those
queries don't "overlap" we shouldn't end up running the slower top level
query more times than we would during regular collection.
This also adds some javadoc to that effect to the two places where we
chose between filter-by-filter and a "native" aggregation
implementation.