-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Closed
Closed
Copy link
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Description
In theory, the Verifier should prevent queries that use aggregation functions to be used outside an aggregation "context", meaning the stats command. For example, from employees | eval x = min(languages) returns a 400 error message
line 1:27: aggregate function [min(languages)] not allowed outside STATS command
While from employees | where min(languages) > 2 returns a 500 error:
path: /_query, params: {format=txt, error_trace=true}, status: 500 org.elasticsearch.xpack.esql.core.QlIllegalArgumentException: Unsupported expression [min(languages)]
at org.elasticsearch.xpack.esql.evaluator.EvalMapper.toEvaluator(EvalMapper.java:96)
at org.elasticsearch.xpack.esql.evaluator.EvalMapper$1.apply(EvalMapper.java:77)
at org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.EsqlBinaryComparison.toEvaluator(EsqlBinaryComparison.java:227)
at org.elasticsearch.xpack.esql.evaluator.EvalMapper.toEvaluator(EvalMapper.java:74)
at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.planFilter(LocalExecutionPlanner.java:700)
The failure to map the where command shouldn't happen, instead the behavior should be caught early on by the Verifier, just like the first scenario.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)