ESQL: Make explicit when METRICS Aggregate requires @timestamp field #112473
Labels
:Analytics/ES|QL
AKA ESQL
>refactoring
Team:Analytics
Meta label for analytical engine team (ESQL/Aggs/Geo)
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 anUnresolvedRelation
to haveindexMode
TIME_SERIES
, it needs to come from parsing aMETRICS
command.Maybe this logic shouldn't be placed inside
UnresolvedRelation
, but instead insideAggregate
- or maybeMERTRICS
should use a specialQueryPlan
class that inherits fromAggregate
, rather than being expressed inAggregate.aggregateType
.The text was updated successfully, but these errors were encountered: