Skip to content

[ES|QL] Return the interval in the column metadata #138146

Description

@stratoula

Description

When the users are using the BUCKET function (BUCKET(@timestamp, 50, start, end)), ES is doing an autobucketing and returns the results. The interval in some cases is not easy to get computed. For example when the date histogram returns only one data point.

In the case of BUCKET(@timestamp, 1 hour) we can find the interval by parsing the query but this is also not super convenient.

We would like in order to fix bugs like this elastic/kibana#215314 to have the interval as metadata information on the response. Kibana then can use this interval to draw the charts correctly.

Activity

  1. added
    Team:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)
    and removed
    needs:triageRequires assignment of a team area label
    on Nov 17, 2025
  2. elasticsearchmachine commented on Nov 17, 2025

    @elasticsearchmachine
    Collaborator

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

  3. alex-spies commented on Jan 9, 2026

    @alex-spies
    Contributor

    Note:

    • For BUCKET(@timestamp, 50, start, end) we can include the start and end in the metadata, given these are constants.
    • For BUCKET(@timestamp, 1 hour) we cannot include a reasonable start and end. These either have to be obtained from the data, e.g. by running an INLINE STATS to get the min/max - or they need to be picked up from the time picker in Kibana.

    Maybe, ESQL could also look at the query that the time picker generates and try to infer the min/max from that; it won't work in all cases, though and would increase complexity a good bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions