elasticsearch
elasticsearch copied to clipboard
[ES|QL] Convert string to datetime when the other size of an arithmetic operator is date_period or time_duration
Resolves : #108432
eval x = 1 day + "2024-01-01"
this will work after this change. Users don't need to call to_dt explicitly like this eval x = 1 day + to_dt("2024-01-01")
Pinging @elastic/es-analytical-engine (Team:Analytics)
Hi @fang-xing-esql, I've created a changelog YAML for you.
Pinging @elastic/kibana-esql (ES|QL-ui)
Thanks @fang-xing-esql , looks good!
I'd increase test coverage a bit, though; maybe we could also add an analyzer/verifier test that confirms that arbitrary functions producing a (foldable) string can't be used, so that e.g.
mv_concat("2024", "-04", "-01") + 1 day
is invalid.
Thanks for reviewing @alex-spies ! More tests are added as suggested.
@costin @astefan @bpintea Could you help take another look at this? Thank you!
Thanks for reviewing @costin @bpintea @alex-spies ! Just need to clean up CI.