Esql implicit casting for date nanos#118697
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Hi @not-napoleon, I've created a changelog YAML for you. |
…-casting-for-date-nanos' into esql-implicit-casting-for-date-nanos
fang-xing-esql
left a comment
There was a problem hiding this comment.
Thank you @not-napoleon ! It looks pretty straightforward, I added a comment about validating data_nanos implicit casting work with some other predicate types.
| 2023-10-23T12:27:28.948Z | 2023-10-23T12:27:28.948000000Z | ||
| 2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | ||
| 2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | ||
| ; |
There was a problem hiding this comment.
Can we add some tests of == and IN with date_nanos constants provided in string format, e.g. nanos == "2023-10-23T13:55:01.543123456Z" and nanos IN ("2023-10-23T13:55:01.543123456Z", "2023-10-23T13:53:55.832987654Z")? I recalled that I came across wrong results when testing the implicit casting from string literals to date with == and IN because the Lucene pushdown query was wrong, just to make sure the pushdown queries work for nanos as well.
There was a problem hiding this comment.
IN isn't supported for date nanos at all yet (that's next on my TODO list), and I'll be sure to add an implicit cast test when I add that support. I'll add a test for == to this PR though. Thanks for the suggestion.
fang-xing-esql
left a comment
There was a problem hiding this comment.
Thank you @not-napoleon! LGTM
💚 Backport successful
|
resolves elastic#118476 This adds an implicit cast from string to date nanos, much the same as we do for millisecond dates. In the course of working on this, I found and fixed a couple of tests that were creating pre-epoch date nanos, which are not supported in elasticsearch. I also refactored the conversion code to use the standard DateUtils functions where appropriate, which caught some of the above errors in test data.
resolves #118476 This adds an implicit cast from string to date nanos, much the same as we do for millisecond dates. In the course of working on this, I found and fixed a couple of tests that were creating pre-epoch date nanos, which are not supported in elasticsearch. I also refactored the conversion code to use the standard DateUtils functions where appropriate, which caught some of the above errors in test data.
resolves elastic#118476 This adds an implicit cast from string to date nanos, much the same as we do for millisecond dates. In the course of working on this, I found and fixed a couple of tests that were creating pre-epoch date nanos, which are not supported in elasticsearch. I also refactored the conversion code to use the standard DateUtils functions where appropriate, which caught some of the above errors in test data.
resolves #118476
This adds an implicit cast from string to date nanos, much the same as we do for millisecond dates. In the course of working on this, I found and fixed a couple of tests that were creating pre-epoch date nanos, which are not supported in elasticsearch. I also refactored the conversion code to use the standard DateUtils functions where appropriate, which caught some of the above errors in test data.