Skip to content

ESQL: Ability to aggregate on _tier metadata #126295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
klacabane opened this issue Apr 4, 2025 · 2 comments
Open

ESQL: Ability to aggregate on _tier metadata #126295

klacabane opened this issue Apr 4, 2025 · 2 comments
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@klacabane
Copy link
Contributor

klacabane commented Apr 4, 2025

Description

Terms aggregation on _tier metadata field results in an error. It is not clear whether this is intended behavior or a bug, but I'd expect this to work since a similar aggregation on _index metadata succeeds.

Use case

The kibana streams plugin shows a graph displaying document counts per tier for data streams managed by an ILM policy.
We currently query the document count per _index and cross that data with _ilm/explain. Aggregating on _tier would simplify the approach.

Issue

POST logs/_search
{
  "track_total_hits": false,
  "size": 0,
  "aggs": {
    "tiers": {
      "terms": {
        "field": "_tier"
      }
    }
  }
}

--->
...
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Fielddata is not supported on field [_tier] of type [_tier]"
      }
    ],
...
}
@klacabane klacabane added >enhancement needs:triage Requires assignment of a team area label labels Apr 4, 2025
@jbaiera jbaiera added :Analytics/Aggregations Aggregations and removed needs:triage Requires assignment of a team area label labels Apr 4, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 4, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@wchaparro
Copy link
Member

Lets move this to ESQL, We won't work on this for legacy Aggregations.

@wchaparro wchaparro added :Analytics/ES|QL AKA ESQL and removed :Analytics/Aggregations Aggregations labels Apr 25, 2025
@wchaparro wchaparro changed the title Ability to aggregate on _tier metadata ESQL: Ability to aggregate on _tier metadata Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

4 participants