Open stratoula opened 2 months ago
Pinging @elastic/kibana-esql (Team:ESQL)
A regression here when casting
FROM kibana_sample_data_logs | EVAL TRIM(agent.keyword) | EVAL TRIM(
TRIM(agent.keyword))
creates an error Argument of [trim] must be [keyword], found value [TRIM(agent.keyword)] type [double]
. This is because we are blindly assuming that any bare function variable is of type double
. Similarly, we are making other mistakes in detecting the types of variables such as blindly choosing the return type of the first signature of the function in an assignment.
Describe the bug:
Here we are gathering bugs related to the client side validation of ES|QL. This means things that we are marking as errors when they are not
from kibana_sample_data_logs | stats avg(to_long(avg(1)))
)[ ]
FROM kibana_sample_data_logs | stats var = percentile(bytes, bytes)
should point out that the second parameter should be constant. However, right now it saysArgument of [=] must be a constant, received [percentile(bytes,bytes)]
[ ] We don't properly validate columns in the
ENRICH ... WITH
list:FROM kibana_sample_data_logs | ENRICH my-policy ON agent.keyword WITH var0 = <field-name>
gives "Unknown column [var0], Unknown column [event.kind]"[ ] Wildcards are lenient and as long as there's another index, the query will be considered valid even if a certain wildcard expression turns up 0 indices, this means that
FROM index1, indexbla*
will return results if index1 exists and indexbla* doesn't return anything. Our client side validation errors out, we should follow ES logic here https://github.com/elastic/kibana/issues/191556[x] Variables created with inline casting don't get the correct type.
row expires = "2024-08-14T01:00:00.000Z" | eval expires_at = expires::datetime | eval days_till = DATE_DIFF("day", now(), expires_at)
yieldsArgument of [date_diff] must be [date], found value [expires_at] type [inlineCast]
. https://github.com/elastic/kibana/pull/195149[x] Trailing decimals are dropped from validation messages. E.g.
BUCKET(@timestamp, 50., ?t_start, ?t_end)
gives this error:Argument of [bucket] must be [integer], found value [50] type [decimal]
. It should show50.
instead of50
. https://github.com/elastic/kibana/pull/196570[x] When casting an ip (might happen to other field types) we are marking this as invalid https://github.com/elastic/kibana/pull/196489
[x]
FROM kibana_sample_data_logs | EVAL TRIM(agent.keyword) | EVAL TRIM(
TRIM(agent.keyword))
creates an errorArgument of [trim] must be [keyword], found value [TRIM(agent.keyword)] type [double]
. This is because we are blindly assuming that any bare function variable is of typedouble
. Similarly, we are making other mistakes in detecting the types of variables such as blindly choosing the return type of the first signature of the function in an assignment.[x] We don't support dotted field names with separate parts escaped https://github.com/elastic/kibana/pull/195149