Skip to content

ESQL: FoldNull folding aggs into literals, raising an "unknown agg" error #110257

@ivancea

Description

@ivancea

When an aggregation is folded by FoldNull, it's converted to something like STATS null, which leads to an error.

Reproduced by using adding a null param to any agg that won't surrogate based on that param being foldable.
Example:

ROW a = 5
| STATS percentile(a, NULL)

Result:

{
  "type": "esql_illegal_argument_exception",
  "reason": "unknown agg: class org.elasticsearch.xpack.esql.core.expression.Literal: null"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions