elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

[ES|QL] Convert string to datetime when the other size of an arithmetic operator is date_period or time_duration

Open fang-xing-esql opened this issue 9 months ago • 2 comments

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")

fang-xing-esql avatar May 09 '24 12:05 fang-xing-esql

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

elasticsearchmachine avatar May 09 '24 12:05 elasticsearchmachine

Hi @fang-xing-esql, I've created a changelog YAML for you.

elasticsearchmachine avatar May 09 '24 12:05 elasticsearchmachine

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

elasticsearchmachine avatar May 31 '24 17:05 elasticsearchmachine

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.

fang-xing-esql avatar May 31 '24 17:05 fang-xing-esql

@costin @astefan @bpintea Could you help take another look at this? Thank you!

fang-xing-esql avatar Jun 03 '24 20:06 fang-xing-esql

Thanks for reviewing @costin @bpintea @alex-spies ! Just need to clean up CI.

fang-xing-esql avatar Jun 04 '24 15:06 fang-xing-esql