Skip to content

ESQL: Make explicit when METRICS Aggregate requires @timestamp field #112473

@alex-spies

Description

@alex-spies

EsqlSession.fieldNames determines what fields from an index are required to compute a query, and is used to construct a field caps request before further analyzing the query.

For METRICS commands, it always determines that the @timestamp field will be required. Currently, UnresolvedRelation.references contains this logic (and it's being moved into EsqlSession.fieldNames in #111413).

However, the exact relationship to the METRICS command is not immediately clear from the code; one has to know that the only way for an UnresolvedRelation to have indexMode TIME_SERIES, it needs to come from parsing a METRICS command.

Maybe this logic shouldn't be placed inside UnresolvedRelation, but instead inside Aggregate - or maybe MERTRICS should use a special QueryPlan class that inherits from Aggregate, rather than being expressed in Aggregate.aggregateType.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions