elastic / elasticsearch

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

ES|QL: support nested fields #107434

Open thomasneirynck opened 5 months ago

thomasneirynck commented 5 months ago

Description

ES|QL should support nested-fields.


Consider something along the lines of:

e.g.: FROM foobar | EXPAND my_nested_field by_path "pathtonestedfield | ...

This would yield a denormalized table, something like

foobar1-fieldX, foobar1-fieldY, ..., childa
foobar1-fieldX, foobar1-fieldY, ..., childb
foobar2-fieldX, foobar2-fieldY, ..., childa
foobar2-fieldX, foobar2-fieldY, ..., childb
foobar2-fieldX, foobar2-fieldY, ..., childc
...

e.g.

FROM foobar | STAT avg_nested(my_nested_field, "child_path") BY ... 

A downstream benefit is that nested-field support in ES|QL would immediately enable visualization support for them in Kibana (https://github.com/elastic/kibana/issues/1084)

thomasneirynck commented 5 months ago

This is similar to https://github.com/elastic/elasticsearch/issues/105637

elasticsearchmachine commented 5 months ago

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

jgb commented 3 months ago

Just to voice my support in favor of this feature. I'm a long time user of elasticsearch, and would love to start exploring ES|SQL, but not supporting nested fields is a showstopper at the moment for most of my data.

syepes commented 1 day ago

+1