[ES|QL][DOCS] Add docs for date_period and time_duration#116368
[ES|QL][DOCS] Add docs for date_period and time_duration#116368fang-xing-esql merged 10 commits intoelastic:mainfrom
Conversation
|
Documentation preview: |
|
Pinging @elastic/es-docs (Team:Docs) |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
bpintea
left a comment
There was a problem hiding this comment.
IMO, if we introduce a detailed chapter on this (which is great), we can shorten the corresponding paragraph in the syntax reference by skipping the list of supported temporal units and linking in the table from the new chapter?
Also, adding some implicit casting examples would be useful (once that's merged).
Thanks for reviewing @bpintea! I just realized that I didn't update #115814 with your suggestions on the implicit casting docs, my bad, so I include them(implicit-casting.asciidoc) in this doc PR. |
Thank you for reviewing @bpintea! I'll wait for @leemthompo to take a final look before merging it. |
leemthompo
left a comment
There was a problem hiding this comment.
Looks good! Few suggested copyedits from me, will check the URL preview again once updates are made, feel free to ping for re-review :)
|
|
||
| Time spans are often used in datetime related grouping functions like <<esql-bucket, BUCKET>>, scalar functions like <<esql-date_trunc, DATE_TRUNC>> and arithmetic operators like <<esql-add, `+`>> and <<esql-subtract, `-`>>. There are conversions functions that can convert string literals to time spans, <<esql-to_dateperiod, TO_DATEPERIOD>>, <<esql-to_timeduration, TO_TIMEDURATION>> and their corresponding <<esql-cast-operator, cast operators>> `::DATE_PERIOD` and `::TIME_DURATION`. | ||
|
|
||
| ==== Examples of using time spans in {esql} |
There was a problem hiding this comment.
| ==== Examples of using time spans in {esql} | |
| [discrete] | |
| [[esql-time-spans-examples]] | |
| ==== Examples of using time spans in {esql} |
There was a problem hiding this comment.
Do you mean [[esql-time-spans-examples]] here? [[esql-time-spans]] has already been used at the beginning of this file.
There was a problem hiding this comment.
certainly did! fixed suggestion :)
Thank you for reviewing @leemthompo ! I have updated the branch with your comments, could you help take a look again when you get a chance? |
Resolves: #112592
We have some descriptions of timespan literals here in the
ES|QLsyntax page, https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-syntax.html#esql-timespan-literalsThis PR is to have a central place to document the usages of
date_periodandtime_durationwith more examples, so that users have a general idea about how they are used in various places inES|QL.