Open
Description
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"
}