mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
This modifies the ESQL test infrastructure to generate more of the documentation for functions. It generates the *Description* section, the *Examples* section, and the *Parameters* section as separate files so we can use them as needed. It also generates a `layout` file that's just a guess as to how to render the whole thing. In some cases it'll work and we can use that instead of hand maintaining a "top level" description file for the function. Most newly generated files are unused. We have to chose to pick them up by replacing the sections we were manually maintaining with an include of the generated section. Or by replacing the entire hand maintained file with the generated top level file. Relates to #104247
38 lines
845 B
Text
38 lines
845 B
Text
[discrete]
|
|
[[esql-greatest]]
|
|
=== `GREATEST`
|
|
|
|
*Syntax*
|
|
|
|
[.text-center]
|
|
image::esql/functions/signature/greatest.svg[Embedded,opts=inline]
|
|
|
|
*Parameters*
|
|
|
|
`first`::
|
|
First of the columns to evaluate.
|
|
|
|
`rest`::
|
|
The rest of the columns to evaluate.
|
|
|
|
*Description*
|
|
|
|
Returns the maximum value from multiple columns. This is similar to <<esql-mv_max>>
|
|
except it is intended to run on multiple columns at once.
|
|
|
|
NOTE: When run on `keyword` or `text` fields, this returns the last string
|
|
in alphabetical order. When run on `boolean` columns this will return
|
|
`true` if any values are `true`.
|
|
|
|
include::types/greatest.asciidoc[]
|
|
|
|
*Example*
|
|
|
|
[source.merge.styled,esql]
|
|
----
|
|
include::{esql-specs}/math.csv-spec[tag=greatest]
|
|
----
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|===
|
|
include::{esql-specs}/math.csv-spec[tag=greatest-result]
|
|
|===
|