Skip to content

Conversation

@jordan-powers
Copy link
Contributor

@jordan-powers jordan-powers commented Feb 4, 2025

Fixes #119696
Fixes #96076

@jordan-powers jordan-powers added :StorageEngine/Downsampling Downsampling (replacement for rollups) - Turn fine-grained time-based data into coarser-grained data >bug labels Feb 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@jordan-powers jordan-powers added auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 and removed Team:StorageEngine labels Feb 4, 2025
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.

One minor comment, LGTM otherwise.

I think merge conflict comes from #121254, shouldn't be to difficult to fix.

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);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe isolate the logic that extracts default metrics in a (static?) method? Then we can maybe add a unit test for this in TransportDownsampleActionTests.

@elasticsearchmachine
Copy link
Collaborator

Hi @jordan-powers, I've created a changelog YAML for you.

builder.field("type", AggregateMetricDoubleFieldMapper.CONTENT_TYPE)
.array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedAggsArray)
.field(AggregateMetricDoubleFieldMapper.Names.DEFAULT_METRIC, defaultMetric)
.array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedMetricsArray)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: looks like you could use stringListField and avoid the array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I thought there might be an API like that, but I couldn't find it. Thanks!

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0

jordan-powers added a commit to jordan-powers/elasticsearch that referenced this pull request Feb 5, 2025
@jordan-powers jordan-powers deleted the fix_119696 branch February 6, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :StorageEngine/Downsampling Downsampling (replacement for rollups) - Turn fine-grained time-based data into coarser-grained data Team:StorageEngine v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

4 participants