Skip to content

Conversation

@limotova
Copy link
Contributor

@limotova limotova commented Sep 22, 2025

This commit enables aggregate_metric_double in ES|QL in non-snapshot builds

Many tests (such as the multi-value tests) were modified in order to handle lack-of-support of aggregate_metric_double and should be addressed in follow-up tasks

@limotova limotova added test-full-bwc Trigger full BWC version matrix tests test-release Trigger CI checks against release build labels Sep 22, 2025
@limotova limotova force-pushed the remove-agg-metric-feature-flag branch 2 times, most recently from 1caa2f6 to e5f891d Compare September 22, 2025 17:50
@limotova limotova force-pushed the remove-agg-metric-feature-flag branch from e5f891d to 2d7876c Compare September 30, 2025 04:43
@github-actions
Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@limotova limotova force-pushed the remove-agg-metric-feature-flag branch 2 times, most recently from a26322e to 77110f6 Compare September 30, 2025 05:58
@limotova limotova force-pushed the remove-agg-metric-feature-flag branch from 282100e to 54d4da8 Compare September 30, 2025 09:36
@limotova limotova added >non-issue :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL labels Sep 30, 2025
@limotova limotova marked this pull request as ready for review September 30, 2025 09:42
@elasticsearchmachine
Copy link
Collaborator

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

FROM test-*
| EVAL a = TO_AGGREGATE_METRIC_DOUBLE(1) // Temporary workaround to enable aggregate_metric_double
| WHERE k8s.pod.uid == \"947e4ced-1786-4e53-9e0c-5c447e959507\"
| WHERE k8s.pod.uid == "947e4ced-1786-4e53-9e0c-5c447e959507"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out this test (Stats from downsampled and non-downsampled index simultaneously with implicit casting) wasn't being run due to a typo in one of the capability names, so I had to make a couple of adjustments to it after changing the capabilities

esql.query:
body:
query: "TS test-* | STATS max = max(k8s.pod.network.rx) | LIMIT 100"
query: "FROM test-* | STATS max = max(k8s.pod.network.rx) | LIMIT 100"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same test as above comment (Stats from downsampled and non-downsampled index simultaneously with implicit casting), since the behavior of TS changed to wrap fields with last_over_time before being handled with non-time-series aggregations, its results would also be different, so I modified the query to produce the same results as before

Copy link
Member

Choose a reason for hiding this comment

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

Probably worth adding back in the other query as a second test, with different output. We can do that in a follow up though. (I think we need to really go over the CSV tests during feature freeze and make sure our coverage is good)

* @see DataType#isRepresentable(DataType)
*/
public static TypeResolution isRepresentableExceptCounters(Expression e, String operationName, ParamOrdinal paramOrd) {
return isType(e, DataType::isRepresentable, operationName, paramOrd, "any type except counter types");
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this and isRepresentableExceptCountersAndSpatial?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is technically being used in MvSort (which I didn't need to modify for these tests interestingly), but it would definitely make sense to use to use isRepresentableExceptCountersAndAggregateMetricDouble there
The latter is unused indeed though
I can remove in a follow-up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nevermind i removed because i had to fix merge conflicts

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! Will leave it to Mark or Nhat to stamp.

Copy link
Member

@not-napoleon not-napoleon left a comment

Choose a reason for hiding this comment

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

LGTM.

/**
* Enable aggregate_metric_double in non-snapshot builds
*/
AGGREGATE_METRIC_DOUBLE_V0,
Copy link
Member

Choose a reason for hiding this comment

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

I am not familiar with this pattern of deprecating capabilities and replacing them with a new one. Where did this come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the same format as what we did for the TS command so I just mimicked what was there

"boolean, cartesian_point, cartesian_shape, datetime, date_nanos, double, geo_point, geo_shape, integer, ip, keyword, long,"
+ " semantic_text, text, unsigned_long or version";
"boolean, cartesian_point, cartesian_shape, date_nanos, datetime, double, geo_point, geo_shape, geohash, geohex, geotile, "
+ "integer, ip, keyword, long, text, unsigned_long or version";
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be included? It looks unrelated. Likewise, in NotEqualsErrorTests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this was intentional (same with NotEqualsErrorTest); this code path wasn't being hit prior, but taking AggregateMetricDouble out of under_construction pulled it into these tests and exposed that the error message was ever so slightly different for whatever reason

esql.query:
body:
query: "TS test-* | STATS max = max(k8s.pod.network.rx) | LIMIT 100"
query: "FROM test-* | STATS max = max(k8s.pod.network.rx) | LIMIT 100"
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth adding back in the other query as a second test, with different output. We can do that in a follow up though. (I think we need to really go over the CSV tests during feature freeze and make sure our coverage is good)

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 Larisa!

@limotova
Copy link
Contributor Author

All tests passed, just status wasn't reported for one of them, so I am merging

@limotova limotova merged commit 0f2b336 into elastic:main Sep 30, 2025
30 of 31 checks passed
@limotova limotova deleted the remove-agg-metric-feature-flag branch September 30, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL Team:StorageEngine test-full-bwc Trigger full BWC version matrix tests test-release Trigger CI checks against release build v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants