Skip to content

Commit ee46291

Browse files
committed
count distinct, and geo-type tests
1 parent ade7ee1 commit ee46291

File tree

10 files changed

+990
-232
lines changed

10 files changed

+990
-232
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/data/k8s-downsampled.csv

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

x-pack/plugin/esql/qa/testFixtures/src/main/resources/data/k8s.csv

Lines changed: 201 additions & 201 deletions
Large diffs are not rendered by default.

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-downsampled-mappings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
"events_received": {
3232
"type": "long"
3333
},
34+
"city": {
35+
"type": "geo_point"
36+
},
37+
"city_boundary": {
38+
"type": "geo_shape"
39+
},
40+
"shape": {
41+
"type": "shape"
42+
},
43+
"location": {
44+
"type": "point"
45+
},
3446
"network": {
3547
"properties": {
3648
"bytes_in": {

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-mappings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727
"events_received": {
2828
"type": "long"
2929
},
30+
"city": {
31+
"type": "geo_point"
32+
},
33+
"city_boundary": {
34+
"type": "geo_shape"
35+
},
36+
"shape": {
37+
"type": "shape"
38+
},
39+
"location": {
40+
"type": "point"
41+
},
3042
"network": {
3143
"properties": {
3244
"bytes_in": {

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries-count-distinct-over-time.csv-spec

Lines changed: 309 additions & 0 deletions
Large diffs are not rendered by default.

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries-count-over-time.csv-spec

Lines changed: 384 additions & 0 deletions
Large diffs are not rendered by default.

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries-first-over-time.csv-spec

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
first_over_time_of_integer_grouping
1+
first_over_time_of_integer
22
required_capability: metrics_command
33
required_capability: first_over_time
44
required_capability: k8s_dataset_additional_fields
@@ -17,6 +17,24 @@ clients:double | cluster:keyword | time_bucket:datetime
1717
672.0 | staging | 2024-05-10T00:03:00.000Z
1818
;
1919

20+
first_over_time_of_long
21+
required_capability: metrics_command
22+
required_capability: first_over_time
23+
TS k8s | STATS bytes = avg(first_over_time(network.bytes_in)) BY cluster, time_bucket = bucket(@timestamp,1minute) | SORT time_bucket, cluster | LIMIT 10;
24+
25+
bytes:double | cluster:keyword | time_bucket:datetime
26+
113.0 | prod | 2024-05-10T00:00:00.000Z
27+
586.0 | staging | 2024-05-10T00:00:00.000Z
28+
628.5 | prod | 2024-05-10T00:01:00.000Z
29+
538.5 | qa | 2024-05-10T00:01:00.000Z
30+
588.0 | prod | 2024-05-10T00:02:00.000Z
31+
749.0 | qa | 2024-05-10T00:02:00.000Z
32+
450.5 | staging | 2024-05-10T00:02:00.000Z
33+
970.0 | prod | 2024-05-10T00:03:00.000Z
34+
481.0 | qa | 2024-05-10T00:03:00.000Z
35+
757.0 | staging | 2024-05-10T00:03:00.000Z
36+
;
37+
2038
first_over_time_with_filtering
2139
required_capability: metrics_command
2240
required_capability: first_over_time

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries-last-over-time.csv-spec

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
last_over_time_of_integer_grouping
1+
last_over_time_of_integer
22
required_capability: metrics_command
33
required_capability: last_over_time
44
required_capability: k8s_dataset_additional_fields
@@ -17,6 +17,24 @@ clients:double | cluster:keyword | time_bucket:datetime
1717
357.0 | staging | 2024-05-10T00:03:00.000Z
1818
;
1919

20+
last_over_time_of_long
21+
required_capability: metrics_command
22+
required_capability: last_over_time
23+
TS k8s | STATS bytes = avg(last_over_time(network.bytes_in)) BY cluster, time_bucket = bucket(@timestamp,1minute) | SORT time_bucket, cluster | LIMIT 10;
24+
25+
bytes:double | cluster:keyword | time_bucket:datetime
26+
677.0 | prod | 2024-05-10T00:00:00.000Z
27+
586.0 | staging | 2024-05-10T00:00:00.000Z
28+
628.5 | prod | 2024-05-10T00:01:00.000Z
29+
538.5 | qa | 2024-05-10T00:01:00.000Z
30+
612.0 | prod | 2024-05-10T00:02:00.000Z
31+
749.0 | qa | 2024-05-10T00:02:00.000Z
32+
382.5 | staging | 2024-05-10T00:02:00.000Z
33+
970.0 | prod | 2024-05-10T00:03:00.000Z
34+
373.0 | qa | 2024-05-10T00:03:00.000Z
35+
612.5 | staging | 2024-05-10T00:03:00.000Z
36+
;
37+
2038
last_over_time_with_filtering
2139
required_capability: metrics_command
2240
required_capability: last_over_time

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ count:long | cluster:keyword | time_bucket:datetime
13391339
;
13401340
count_distinct_over_time
13411341
required_capability: metrics_command
1342-
required_capability: distinct_over_time
1342+
required_capability: count_distinct_over_time
13431343

13441344
// tag::count_distinct_over_time[]
13451345
TS k8s

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,11 @@ public enum Cap {
11731173
*/
11741174
K8S_DATASET_ADDITIONAL_FIELDS(Build.current().isSnapshot()),
11751175

1176+
/**
1177+
* Geospatial field types in the k8s.csv and k8s-downsampled.csv datasets
1178+
*/
1179+
K8S_DATASETS_GEOSPATIAL_FIELDS(Build.current().isSnapshot()),
1180+
11761181
/**
11771182
* Resolve groupings before resolving references to groupings in the aggregations.
11781183
*/

0 commit comments

Comments
 (0)