elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.62k stars 24.64k forks source link

[ES|QL] Support date_period and time_duration in named parameters #111717

Open fang-xing-esql opened 1 month ago

fang-xing-esql commented 1 month ago

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 and time_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 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.

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

elasticsearchmachine commented 1 month ago

Pinging @elastic/kibana-esql (ES|QL-ui)