elasticsearch/docs/reference/query-languages/esql/_snippets/functions/mv_concat.md

969 B

MV_CONCAT [esql-mv_concat]

Syntax

:::{image} ../../../../../images/mv_concat.svg :alt: Embedded :class: text-center :::

Parameters

string
Multivalue expression.
delim
Delimiter.

Description

Converts a multivalued string expression into a single valued column containing the concatenation of all values separated by a delimiter.

Supported types

string delim result
keyword keyword keyword
keyword text keyword
text keyword keyword
text text keyword

Examples

ROW a=["foo", "zoo", "bar"]
| EVAL j = MV_CONCAT(a, ", ")
a:keyword j:keyword
["foo", "zoo", "bar"] "foo, zoo, bar"

To concat non-string columns, call TO_STRING first:

ROW a=[10, 9, 8]
| EVAL j = MV_CONCAT(TO_STRING(a), ", ")
a:integer j:keyword
[10, 9, 8] "10, 9, 8"