elastic / elasticsearch

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

[ESQL] create TO_DATE_NANOS function #111842

Open not-napoleon opened 1 month ago

not-napoleon commented 1 month ago

Similar to TO_DATETIME, but returning a date nanos type. It should accept the same set of types as TO_DATETIME:

elasticsearchmachine commented 1 month ago

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

not-napoleon commented 3 weeks ago

Giving this some more thought, I'm not sure it makes sense to allow Integer as an input. Max int being around 2 billion, in nanosecond time, puts it seconds after epoch. It seems much more likely that a user attempting to do this has made an error and we should warn them at parse time.

nik9000 commented 3 weeks ago

If folks really want an integer as an input they can do TO_DATE_NANOS(TO_LONG(iii))