Today, users can specify a numeric value or string in parameters, and they will be mapped automatically as an ES|QL data type. However in order to have EL|QL map a string to a date_period or time_duration correctly, one option is to have user cast the string to date_period or time_duration explicitly, and in order to support explicit casting to date_period or time_duration, conversion(from string to date_period or time_duration) functions are needed.
Description
During the review of named parameter, an issue(https://github.com/elastic/elasticsearch/pull/108421#discussion_r1601658933) was brought up that we need a way to support
date_period
andtime_duration
in named parameter.Today, users can specify a numeric value or string in parameters, and they will be mapped automatically as an
ES|QL
data type. However in order to haveEL|QL
map a string to adate_period
ortime_duration
correctly, one option is to have user cast the string todate_period
ortime_duration
explicitly, and in order to support explicit casting todate_period
ortime_duration
, conversion(from string todate_period
ortime_duration
) functions are needed.