[ESQL] test date nanos union type#116265
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
So I discovered a bunch of these tests weren't running locally. I've fixed most of them, but there's still one failing for me that requires deeper investigation. |
|
The remaining test failure is due to #116346, I think. |
|
Should be fixed now. Let's see what CI thinks. |
| ; | ||
|
|
||
| @timestamp:date_nanos | client_ip:ip | event_duration:long | message:keyword | ||
| 2023-10-23T13:55:01.543Z | 172.21.3.15 | 1756467 | Connected to 10.1.0.1 |
There was a problem hiding this comment.
I was expecting here a bunch if zeros after the decimal dot.
I see them here and it seems right.
There was a problem hiding this comment.
This happens because the date nanos expected values parsing uses the ISO_DATE_WITH_NANOS saved format, which specifies .appendFraction(NANO_OF_SECOND, 3, 9, true). The 3, 9 there specifies a minimum "width" (i.e. number of digits) of 3 and a maximum of 9, so either format would be acceptable.
That said, it's easy enough to add in the zeros, I'll push that up in a moment. While I was looking at it, I noticed that when I wrote the value parsing logic, I missed an opportunity to use the library function for it, so I've replaced my math with that. This gets us a little extra error checking for expected values.
|
@elasticmachine test this please |
|
@elasticmachine update branch |
💚 Backport successful
|
Resolves elastic#112885 This PR adds a bunch of basic testing for using TO_DATE_NANOS as a union type. It also tests the TO_DATETIME union type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Resolves #112885 This PR adds a bunch of basic testing for using TO_DATE_NANOS as a union type. It also tests the TO_DATETIME union type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Resolves elastic#112885 This PR adds a bunch of basic testing for using TO_DATE_NANOS as a union type. It also tests the TO_DATETIME union type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [ESQL] test date nanos union type (#116265) Resolves #112885 This PR adds a bunch of basic testing for using TO_DATE_NANOS as a union type. It also tests the TO_DATETIME union type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * add capability check * add capability check --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Resolves elastic#112885 This PR adds a bunch of basic testing for using TO_DATE_NANOS as a union type. It also tests the TO_DATETIME union type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Resolves #112885
This PR adds a bunch of basic testing for using
TO_DATE_NANOSas a union type. It also tests theTO_DATETIMEunion type for casting date nanos. There are still some cases that aren't covered here, mostly because we haven't finished adding date nanos support to all the relevant functions. I expect we'll add in those cases as we add functions support.