ES|QL: Support ::date in inline cast#123460
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
buildkite test this |
|
Pinging @elastic/kibana-esql (ES|QL-ui) |
fang-xing-esql
left a comment
There was a problem hiding this comment.
Thank you for contributing to Elasticsearch @kanoshiou ! I added some comments around the new tests.
| ; | ||
|
|
||
| convertToDate | ||
| required_capability: casting_operator |
There was a problem hiding this comment.
We'll need a new entry in EsqlCapabilities for ::date's tests, as the older versions don't recognize ::date.
And can we add more tests for ::date? A date field can appear in a lot of places of a query, there are some queries with ::datetime used with + and - can be used as references, it can be used in eval, where etc.
There was a problem hiding this comment.
I initially thought it was sufficient to test only the basic casting functionality, as ::date utilizes the same function as ::datetime.
However, you are absolutely right—there’s no guarantee that this situation will remain unchanged forever. Therefore, adding additional tests is essential.
There was a problem hiding this comment.
Thank you for addressing the comments @kanoshiou! It looks pretty good to me.
|
Thank you for reviewing @fang-xing-esql! I have updated the test, please take another look when you have the time. |
|
buildkite test this |
|
buildkite test this |
fang-xing-esql
left a comment
There was a problem hiding this comment.
LGTM, thank you @kanoshiou!
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* Inline cast to date * Update docs/changelog/123460.yaml * New capability for `::date` casting * More tests * Update tests --------- Co-authored-by: Fang Xing <155562079+fang-xing-esql@users.noreply.github.com> (cherry picked from commit deff3df) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java Co-authored-by: kanoshiou <73424326+kanoshiou@users.noreply.github.com>
* Inline cast to date * Update docs/changelog/123460.yaml * New capability for `::date` casting * More tests * Update tests --------- Co-authored-by: Fang Xing <155562079+fang-xing-esql@users.noreply.github.com>
* Inline cast to date * Update docs/changelog/123460.yaml * New capability for `::date` casting * More tests * Update tests --------- Co-authored-by: Fang Xing <155562079+fang-xing-esql@users.noreply.github.com>
Closes #116746