Skip to content

Commit

Permalink
Add docs clarifications on DATE_DIFF args (#108301)
Browse files Browse the repository at this point in the history
This adds some clarifications on the time unit strings the function
takes as arguments, noting the differences between these and the time
span literals, as well as the abbreviations' source.
  • Loading branch information
bpintea authored May 7, 2024
1 parent 26db243 commit de725ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/reference/esql/functions/description/date_diff.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ s|abbreviations
| microsecond | microseconds, mcs
| nanosecond | nanoseconds, ns
|===

Note that while there is an overlap between the function's supported units and
{esql}'s supported time span literals, these sets are distinct and not
interchangeable. Similarly, the supported abbreviations are conveniently shared
with implementations of this function in other established products and not
necessarily common with the date-time nomenclature used by {es}.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ public static Part resolve(String dateTimeUnit) {
| millisecond | milliseconds, ms
| microsecond | microseconds, mcs
| nanosecond | nanoseconds, ns
|===""", examples = @Example(file = "date", tag = "docsDateDiff"))
|===
Note that while there is an overlap between the function's supported units and
{esql}'s supported time span literals, these sets are distinct and not
interchangeable. Similarly, the supported abbreviations are conveniently shared
with implementations of this function in other established products and not
necessarily common with the date-time nomenclature used by {es}.""", examples = @Example(file = "date", tag = "docsDateDiff"))
public DateDiff(
Source source,
@Param(name = "unit", type = { "keyword", "text" }, description = "Time difference unit") Expression unit,
Expand Down

0 comments on commit de725ae

Please sign in to comment.