@@ -75,7 +75,7 @@ and then grouping - that is not going to be faster.
75
75
::: :
76
76
77
77
78
- ** Examples**
78
+ # ## Examples
79
79
80
80
Calculating a statistic and grouping by the values of another column :
81
81
@@ -104,15 +104,17 @@ optional as well:
104
104
:::{include} ../examples/stats.csv-spec/aggFilteringNoGroup.md
105
105
:: :
106
106
107
- $$$esql-stats-mv-group$$$
108
- If the grouping key is multivalued then the input row is in all groups :
107
+ It’s also possible to group by multiple values :
109
108
110
- :::{include} ../examples/stats.csv-spec/mv-group .md
109
+ :::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues .md
111
110
:: :
112
111
113
- It’s also possible to group by multiple values :
112
+ $$$esql-stats-mv-group$$$
113
+ # ### Multivalued inputs
114
114
115
- :::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues.md
115
+ If the grouping key is multivalued then the input row is in all groups :
116
+
117
+ :::{include} ../examples/stats.csv-spec/mv-group.md
116
118
:: :
117
119
118
120
If all the grouping keys are multivalued then the input row is in all groups :
@@ -132,6 +134,11 @@ key. If you want to send the group key to the function then `MV_EXPAND` first:
132
134
:::{include} ../examples/stats.csv-spec/mv-group-values-expand.md
133
135
:: :
134
136
137
+ Refer to [elasticsearch/issues/134792](https://github.com/elastic/elasticsearch/issues/134792#issuecomment-3361168090)
138
+ for an even more in depth explanation.
139
+
140
+ # ### Multivalue functions
141
+
135
142
Both the aggregating functions and the grouping expressions accept other
136
143
functions. This is useful for using `STATS` on multivalue columns.
137
144
For example, to calculate the average salary change, you can use `MV_AVG` to
@@ -147,6 +154,8 @@ letter of their last name:
147
154
:::{include} ../examples/stats.csv-spec/docsStatsByExpression.md
148
155
:: :
149
156
157
+ # ### Naming
158
+
150
159
Specifying the output column name is optional. If not specified, the new column
151
160
name is equal to the expression. The following query returns a column named
152
161
`AVG(salary)` :
0 commit comments