mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
* Functions E-Z * Incorporate changes from #103686 * More functions * More functions * Update docs/reference/esql/functions/floor.asciidoc Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> * Update docs/reference/esql/functions/left.asciidoc Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alexander Spies <alexander.spies@elastic.co> * Review feedback * Fix geo_shape description * Change 'colum'/'field' into 'expressions' * Review feedback * One more --------- Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> Co-authored-by: Alexander Spies <alexander.spies@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
45 lines
846 B
Text
45 lines
846 B
Text
[discrete]
|
|
[[esql-to_boolean]]
|
|
=== `TO_BOOLEAN`
|
|
|
|
*Alias*
|
|
|
|
`TO_BOOL`
|
|
|
|
*Syntax*
|
|
|
|
[source,esql]
|
|
----
|
|
TO_BOOLEAN(v)
|
|
----
|
|
|
|
*Parameters*
|
|
|
|
`v`::
|
|
Input value. The input can be a single- or multi-valued column or an expression.
|
|
|
|
*Description*
|
|
|
|
Converts an input value to a boolean value.
|
|
|
|
A string value of *"true"* will be case-insensitive converted to the Boolean
|
|
*true*. For anything else, including the empty string, the function will
|
|
return *false*.
|
|
|
|
The numerical value of *0* will be converted to *false*, anything else will be
|
|
converted to *true*.
|
|
|
|
*Supported types*
|
|
|
|
The input type must be of a string or numeric type.
|
|
|
|
*Example*
|
|
|
|
[source.merge.styled,esql]
|
|
----
|
|
include::{esql-specs}/boolean.csv-spec[tag=to_boolean]
|
|
----
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|===
|
|
include::{esql-specs}/boolean.csv-spec[tag=to_boolean-result]
|
|
|===
|