|
@@ -2276,34 +2276,6 @@ M
|
|
|
null
|
|
|
;
|
|
|
|
|
|
-docsStatsMvGroup
|
|
|
-// tag::mv-group[]
|
|
|
-ROW i=1, a=["a", "b"] | STATS MIN(i) BY a | SORT a ASC
|
|
|
-// end::mv-group[]
|
|
|
-;
|
|
|
-
|
|
|
-// tag::mv-group-result[]
|
|
|
-MIN(i):integer | a:keyword
|
|
|
- 1 | a
|
|
|
- 1 | b
|
|
|
-// end::mv-group-result[]
|
|
|
-;
|
|
|
-
|
|
|
-docsStatsMultiMvGroup
|
|
|
-// tag::multi-mv-group[]
|
|
|
-ROW i=1, a=["a", "b"], b=[2, 3] | STATS MIN(i) BY a, b | SORT a ASC, b ASC
|
|
|
-// end::multi-mv-group[]
|
|
|
-;
|
|
|
-
|
|
|
-// tag::multi-mv-group-result[]
|
|
|
-MIN(i):integer | a:keyword | b:integer
|
|
|
- 1 | a | 2
|
|
|
- 1 | a | 3
|
|
|
- 1 | b | 2
|
|
|
- 1 | b | 3
|
|
|
-// end::multi-mv-group-result[]
|
|
|
-;
|
|
|
-
|
|
|
statsByConstant#[skip:-8.14.1,reason:implemented in 8.14]
|
|
|
from employees
|
|
|
| stats m = max(salary), a = round(avg(salary)) by 0
|
|
@@ -3301,3 +3273,74 @@ FROM employees
|
|
|
min1:integer | min2:integer | max1:integer | max2:integer
|
|
|
10011 | [10011, 10012] | 10079 | [10079, 10078]
|
|
|
;
|
|
|
+
|
|
|
+sumRowMany
|
|
|
+// tag::mv-group[]
|
|
|
+ROW price = 10, color = ["blue", "pink", "yellow"]
|
|
|
+| STATS SUM(price) BY color
|
|
|
+// end::mv-group[]
|
|
|
+| SORT color ASC
|
|
|
+;
|
|
|
+
|
|
|
+// tag::mv-group-result[]
|
|
|
+SUM(price):long | color:keyword
|
|
|
+ 10 | blue
|
|
|
+ 10 | pink
|
|
|
+ 10 | yellow
|
|
|
+// end::mv-group-result[]
|
|
|
+;
|
|
|
+
|
|
|
+sumRowManyTwo
|
|
|
+// tag::multi-mv-group[]
|
|
|
+ROW price = 10, color = ["blue", "pink", "yellow"], size = ["s", "m", "l"]
|
|
|
+| STATS SUM(price) BY color, size
|
|
|
+// end::multi-mv-group[]
|
|
|
+| SORT color ASC, size ASC
|
|
|
+;
|
|
|
+
|
|
|
+// tag::multi-mv-group-result[]
|
|
|
+SUM(price):long | color:keyword | size:keyword
|
|
|
+ 10 | blue | l
|
|
|
+ 10 | blue | m
|
|
|
+ 10 | blue | s
|
|
|
+ 10 | pink | l
|
|
|
+ 10 | pink | m
|
|
|
+ 10 | pink | s
|
|
|
+ 10 | yellow | l
|
|
|
+ 10 | yellow | m
|
|
|
+ 10 | yellow | s
|
|
|
+// end::multi-mv-group-result[]
|
|
|
+;
|
|
|
+
|
|
|
+valuesRowMany
|
|
|
+// tag::mv-group-values[]
|
|
|
+ROW color = ["blue", "pink", "yellow"]
|
|
|
+| STATS VALUES(color) BY color
|
|
|
+// end::mv-group-values[]
|
|
|
+| SORT color ASC
|
|
|
+;
|
|
|
+
|
|
|
+// tag::mv-group-values-result[]
|
|
|
+VALUES(color):keyword | color:keyword
|
|
|
+ [blue, pink, yellow] | blue
|
|
|
+ [blue, pink, yellow] | pink
|
|
|
+ [blue, pink, yellow] | yellow
|
|
|
+// end::mv-group-values-result[]
|
|
|
+;
|
|
|
+
|
|
|
+valuesRowManyExpand
|
|
|
+// tag::mv-group-values-expand[]
|
|
|
+ROW color = ["blue", "pink", "yellow"]
|
|
|
+| MV_EXPAND color
|
|
|
+| STATS VALUES(color) BY color
|
|
|
+// end::mv-group-values-expand[]
|
|
|
+| SORT color ASC
|
|
|
+;
|
|
|
+
|
|
|
+// tag::mv-group-values-expand-result[]
|
|
|
+VALUES(color):keyword | color:keyword
|
|
|
+ blue | blue
|
|
|
+ pink | pink
|
|
|
+ yellow | yellow
|
|
|
+// end::mv-group-values-expand-result[]
|
|
|
+;
|