With #109193 users can provide Date_Period or Time_Duration intervals in EsqlQueryRequest params by casting them to the desired types, here is an example,
{
"query": "from sample_data | stats var0 = AVG(event.duration) by BUCKET(@timestamp, ?interval::time_duration)",
"params": [
{
"interval": "1 minute"
}
]
}
The goal of this issue is to do implicit casting from string literals to Date_Period or Time_Duration, so that users don't have to convert them explicitly, like the examples below.
{
"query": "from sample_data | stats var0 = AVG(event.duration) by BUCKET(@timestamp, ?interval)",
"params": [
{
"interval": "1 minute"
}
]
}
There are some other places that Date_Period or Time_Duration intervals can be used besides BUCKET, like datetime +/- intervals, we will try to make it work also, more examples will be added.
With #109193 users can provide
Date_PeriodorTime_Durationintervals inEsqlQueryRequestparams by casting them to the desired types, here is an example,The goal of this issue is to do implicit casting from string literals to
Date_PeriodorTime_Duration, so that users don't have to convert them explicitly, like the examples below.There are some other places that
Date_PeriodorTime_Durationintervals can be used besidesBUCKET, like datetime +/- intervals, we will try to make it work also, more examples will be added.