Skip to content

Conversation

limotova
Copy link
Contributor

@limotova limotova commented Feb 15, 2025

This commit allows users to read aggregate_metric_double fields from
indices in ES|QL, with any subset of metrics.

@limotova limotova force-pushed the rendering-aggregate-metric-double branch 3 times, most recently from 444a9db to 81ba0dc Compare February 15, 2025 06:13
AmigosKazz

This comment was marked as spam.

@limotova limotova force-pushed the rendering-aggregate-metric-double branch from 81ba0dc to 249e067 Compare February 18, 2025 23:49
@limotova limotova force-pushed the rendering-aggregate-metric-double branch from 631838a to ecb53f6 Compare February 19, 2025 00:00
for (var block : blocks) {
max = Math.max(max, block.getValueCount(position));
}
return max;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I implemented this to just return the max of all the blocks, not sure if we wanted to go with some other logic? (Like end early if a block ever returns getValueCount of 1)

Copy link
Member

Choose a reason for hiding this comment

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

I think we can avoid this - see my comment in the evaluator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we do still need some way of computing this for CompositeBlock though, I ran into it here

Copy link
Member

Choose a reason for hiding this comment

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

I see. It's fine to use the max count here, but I think it's less error-prone not to implement this method. Alternatively, can we check the data type and convert the value at that position within the composite block in valueAtPosition? I'm also fine leaving it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would make sense to adjust this later

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add an assertion or check that this logic is only valid for aggregate_metric_double fields? We can add this in a follow up given that this functionality is only available in snapshot builds. Can you add this to the list of tasks?

@dnhatn dnhatn self-requested a review February 19, 2025 06:17
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.

I've left some comments, but it looks good. Thanks Larisa!

for (var block : blocks) {
max = Math.max(max, block.getValueCount(position));
}
return max;
Copy link
Member

Choose a reason for hiding this comment

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

I think we can avoid this - see my comment in the evaluator.

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.

This looks good!

@limotova limotova requested a review from nik9000 February 19, 2025 22:08
@limotova limotova marked this pull request as ready for review February 19, 2025 22:08
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Feb 19, 2025
@limotova limotova added >enhancement auto-backport Automatically create backport pull requests when merged :StorageEngine/TSDB You know, for Metrics :Analytics/Compute Engine Analytics in ES|QL and removed needs:triage Requires assignment of a team area label labels Feb 19, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine labels Feb 19, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @limotova, I've created a changelog YAML for you.

@limotova limotova added :Analytics/ES|QL AKA ESQL and removed :Analytics/Compute Engine Analytics in ES|QL labels Feb 19, 2025
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!

@dnhatn dnhatn added the v8.19.0 label Feb 20, 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.

LGTM

for (var block : blocks) {
max = Math.max(max, block.getValueCount(position));
}
return max;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add an assertion or check that this logic is only valid for aggregate_metric_double fields? We can add this in a follow up given that this functionality is only available in snapshot builds. Can you add this to the list of tasks?

@limotova limotova merged commit e4ee91a into elastic:main Feb 20, 2025
17 checks passed
@limotova limotova deleted the rendering-aggregate-metric-double branch February 20, 2025 08:38
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x
limotova added a commit that referenced this pull request Feb 20, 2025
This commit allows users to read aggregate_metric_double fields from indices in ES|QL, with any subset of metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >enhancement :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine v8.19.0 v9.1.0

5 participants