Skip to content

ESQL: Inconsistent/buggy behavior for stats with null expression #104900

@alex-spies

Description

@alex-spies

Given an index testidx, the query from testidx | STATS some_agg_function(null) behaves differently for different aggregations:

  • from testidx | STATS count(null) returns the number of documents (like count(*)).
  • from testidx | STATS avg(null) returns a row containing null for every document. Will be solved by ESQL: Sum, Min, Max and Avg of constants #105454.
  • from testidx | STATS max(null) returns a 500 ({"type":"esql_illegal_argument_exception","reason":"unknown agg: class org.elasticsearch.xpack.ql.expression.Literal: null"}) This is also the behavior of all other aggregations. This is already reported here

Metadata

Metadata

Assignees

Labels

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