Copy metrics and default_metric properties when downsampling aggregate_metric_double#121727
Merged
jordan-powers merged 8 commits intoelastic:mainfrom Feb 5, 2025
Merged
Copy metrics and default_metric properties when downsampling aggregate_metric_double#121727jordan-powers merged 8 commits intoelastic:mainfrom
jordan-powers merged 8 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
martijnvg
approved these changes
Feb 5, 2025
| List<String> supportedAggs = List.of(metricType.supportedAggs()); | ||
| // We choose max as the default metric | ||
| final String defaultMetric = List.of(supportedAggsArray).contains("max") ? "max" : supportedAggsArray[0]; | ||
| String defaultMetric = supportedAggs.contains("max") ? "max" : supportedAggs.get(0); |
Member
There was a problem hiding this comment.
Maybe isolate the logic that extracts default metrics in a (static?) method? Then we can maybe add a unit test for this in TransportDownsampleActionTests.
Collaborator
|
Hi @jordan-powers, I've created a changelog YAML for you. |
088bd78 to
53193f3
Compare
lkts
approved these changes
Feb 5, 2025
| builder.field("type", AggregateMetricDoubleFieldMapper.CONTENT_TYPE) | ||
| .array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedAggsArray) | ||
| .field(AggregateMetricDoubleFieldMapper.Names.DEFAULT_METRIC, defaultMetric) | ||
| .array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedMetricsArray) |
Contributor
There was a problem hiding this comment.
nit: looks like you could use stringListField and avoid the array
Contributor
Author
There was a problem hiding this comment.
Ah, I thought there might be an API like that, but I couldn't find it. Thanks!
jordan-powers
added a commit
to jordan-powers/elasticsearch
that referenced
this pull request
Feb 5, 2025
…e_metric_double (elastic#121727) Fixes elastic#119696 and elastic#96076
Collaborator
jordan-powers
added a commit
to jordan-powers/elasticsearch
that referenced
this pull request
Feb 5, 2025
…e_metric_double (elastic#121727) Fixes elastic#119696 and elastic#96076
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2025
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2025
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2025
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.
Fixes #119696
Fixes #96076