elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.42k stars 24.87k forks source link

[ES|QL] Support 2-n arguments for MV_APPEND #114436

Open dgieselaar opened 1 month ago

dgieselaar commented 1 month ago

Currently, MV_APPEND expects exactly two arguments:

MV_APPEND(a, b)

appending more than two fields needs something like this:

MV_APPEND(a,MV_APPEND(b,c))

Ideally MV_APPEND supports 2-n number of arguments:

MV_APPEND(a, b, c)

Bonus points for some kind of way of being able to handle null values in a way that MV_APPEND will just ignore the value instead of returning null, but not really related to this ask. Right now the workaround for me is to COALESCE into a string that I can later match on to remove items again. Alternatively, something like array literals would be amazing:

`MV_APPEND(a, b, COALESCE(c, []))

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)