ES|QL COALESCE function
first- Expression to evaluate.
rest-
Other expression to evaluate.
Returns the first of its arguments that is not null. If all arguments are null, it returns null.
| first | rest | result |
|---|---|---|
| boolean | boolean | boolean |
| boolean | boolean | |
| cartesian_point | cartesian_point | cartesian_point |
| cartesian_shape | cartesian_shape | cartesian_shape |
| date | date | date |
| date_nanos | date_nanos | date_nanos |
| exponential_histogram
|
exponential_histogram
|
exponential_histogram |
| geo_point | geo_point | geo_point |
| geo_shape | geo_shape | geo_shape |
| geohash | geohash | geohash |
| geohex | geohex | geohex |
| geotile | geotile | geotile |
| histogram
|
histogram
|
histogram |
| integer | integer | integer |
| integer | integer | |
| ip | ip | ip |
| keyword | keyword | keyword |
| keyword | keyword | |
| long | long | long |
| long | long | |
| tdigest
|
tdigest
|
tdigest |
| text | text | keyword |
| text | keyword | |
| version | version | version |
ROW a=null, b="b"
| EVAL COALESCE(a, b)
| a:null | b:keyword | COALESCE(a, b):keyword |
|---|---|---|
| null | b | b |