Skip to content

Commit a633806

Browse files
committed
more CSV tests
1 parent 1deb2d4 commit a633806

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/categorize.csv-spec

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ COUNT():long | VALUES(str):keyword | category:keyword
6060
1 | [a, b, c] | .*?disconnected.*?
6161
;
6262

63+
limit before stats
64+
required_capability: categorize_v5
65+
66+
FROM sample_data | SORT message | LIMIT 4
67+
| STATS count=COUNT() BY category=CATEGORIZE(message)
68+
| SORT category
69+
;
70+
71+
count:long | category:keyword
72+
3 | .*?Connected.+?to.*?
73+
1 | .*?Connection.+?error.*?
74+
;
75+
6376
skips stopwords
6477
required_capability: categorize_v5
6578

@@ -647,6 +660,22 @@ count:long | category:keyword | timestamp:datetime
647660
1 | .*?Disconnected.*? | 2023-10-23T13:00:00.000Z
648661
;
649662

663+
664+
multiple groupings with categorize and limit before stats
665+
required_capability: categorize_v5
666+
667+
FROM sample_data | SORT message | LIMIT 5
668+
| STATS count=COUNT() BY category=CATEGORIZE(message), client_ip
669+
| SORT category, client_ip
670+
;
671+
672+
count:long | category:keyword | client_ip:ip
673+
1 | .*?Connected.+?to.*? | 172.21.2.113
674+
1 | .*?Connected.+?to.*? | 172.21.2.162
675+
1 | .*?Connected.+?to.*? | 172.21.3.15
676+
2 | .*?Connection.+?error.*? | 172.21.3.15
677+
;
678+
650679
multiple groupings with categorize and nulls
651680
required_capability: categorize_multiple_groupings
652681

@@ -741,3 +770,17 @@ lang_low:double | lang_high:double | category:keyword | gender:keyword
741770
3.0 | 3.25 | .*?Architect.*? | F
742771
3.75 | null | .*?Architect.*? | M
743772
;
773+
774+
multiple groupings with categorize on null row
775+
required_capability: categorize_multiple_groupings
776+
777+
ROW message = null, str = ["a", "b", "c"]
778+
| STATS COUNT(), VALUES(str) BY category=CATEGORIZE(message), str
779+
| SORT str
780+
;
781+
782+
COUNT():long | VALUES(str):keyword | category:keyword | str:keyword
783+
1 | [a, b, c] | null | a
784+
1 | [a, b, c] | null | b
785+
1 | [a, b, c] | null | c
786+
;

0 commit comments

Comments
 (0)