-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Open
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
I think there are interesting queries where we're interested both in per-group stats and global stats, like so:
...
| INLINE STATS total_median = MEDIAN(field)
| STATS per_group_median = MEDIAN(field), total_median = VALUES(total_median) BY group
or so:
...
| STATS per_group_min = MIN(field) BY group
| INLINE STATS total_min = min(per_group_min)
or:
...
| STATS ... BY b = BUCKET(field, 1 year), group
| INLINE STATS min_b = MIN(b)
Normally, INLINE STATS needs to run the first part of the query twice. That's wasteful. We're already aggregating. It'd be much nicer if we could compute the INLINE STATS alongside the STATS.
That's currently not possible because the INLINE STATS do not have a BY in these examples - so we'd need a way to compute an agg function over all values alongside agg functions that are per grouping.
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)