Skip to content

Add rule to wrap bare metrics in default over time function#140090

Merged
felixbarny merged 15 commits intoelastic:mainfrom
felixbarny:default-over-time
Jan 11, 2026
Merged

Add rule to wrap bare metrics in default over time function#140090
felixbarny merged 15 commits intoelastic:mainfrom
felixbarny:default-over-time

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented Dec 30, 2025

Adds an optimizer rule without wiring it that inserts a default inner aggregation. This is a part of #140135 where this rule will get wired.

related to #138702

@felixbarny felixbarny requested a review from dnhatn December 30, 2025 22:31
@elasticsearchmachine elasticsearchmachine added v9.4.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Dec 30, 2025
@felixbarny felixbarny changed the title Improve wrapping of bare metrics in default over time function Add rule to wrap bare metrics in default over time function Jan 8, 2026
@felixbarny felixbarny marked this pull request as ready for review January 8, 2026 13:20
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Jan 8, 2026
@felixbarny felixbarny self-assigned this Jan 8, 2026
@felixbarny felixbarny added >non-issue :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL labels Jan 8, 2026
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine and removed needs:triage Requires assignment of a team area label labels Jan 8, 2026
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

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

Looks good to me, it may be a good idea to have @alex-spies take a look too.

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Felix!

}

public LogicalPlan rule(TimeSeriesAggregate aggregate) {
List<NamedExpression> newAggregates = aggregate.aggregates().stream().map(agg -> {
Copy link
Member

Choose a reason for hiding this comment

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

Should we use transform here? Also, can we avoid changing the aggregate if we are not injecting an over_time aggregation?

@felixbarny felixbarny merged commit bad616e into elastic:main Jan 11, 2026
35 checks passed
@felixbarny felixbarny deleted the default-over-time branch January 11, 2026 08:59
jimczi pushed a commit to jimczi/elasticsearch that referenced this pull request Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants