Skip to content

Commit 5558b79

Browse files
committed
Add inline stats test on agg_metric
1 parent f7b0523 commit 5558b79

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,3 +3874,24 @@ city:keyword|c:long
38743874
Raleigh |1
38753875
;
38763876

3877+
inlineStatsOnAggregateMetricDouble
3878+
required_capability: inline_stats
3879+
required_capability: aggregate_metric_double_literal_registered
3880+
FROM k8s-downsampled
3881+
| INLINE STATS tx_max = MAX(network.eth0.tx) BY pod
3882+
| SORT @timestamp, cluster, pod
3883+
| KEEP @timestamp, cluster, pod, network.eth0.tx, tx_max
3884+
| LIMIT 9
3885+
;
3886+
3887+
@timestamp:datetime | cluster:keyword | pod:keyword | network.eth0.tx:aggregate_metric_double | tx_max:double
3888+
2024-05-09T23:30:00.000Z | prod | one | {"min":565.0,"max":829.0,"sum":7290.0,"value_count":10} | 1060.0
3889+
2024-05-09T23:30:00.000Z | prod | three | {"min":201.0,"max":582.0,"sum":1794.0,"value_count":6} | 824.0
3890+
2024-05-09T23:30:00.000Z | prod | two | {"min":20.0,"max":190.0,"sum":370.0,"value_count":10} | 1419.0
3891+
2024-05-09T23:30:00.000Z | qa | one | {"min":346.0,"max":356.0,"sum":1765.0,"value_count":5} | 1060.0
3892+
2024-05-09T23:30:00.000Z | qa | three | {"min":605.0,"max":605.0,"sum":605.0,"value_count":1} | 824.0
3893+
2024-05-09T23:30:00.000Z | qa | two | {"min":304.0,"max":1148.0,"sum":8590.0,"value_count":10} | 1419.0
3894+
2024-05-09T23:30:00.000Z | staging | one | {"min":263.0,"max":740.0,"sum":5390.0,"value_count":10} | 1060.0
3895+
2024-05-09T23:30:00.000Z | staging | three | {"min":341.0,"max":592.0,"sum":1956.0,"value_count":5} | 824.0
3896+
2024-05-09T23:30:00.000Z | staging | two | {"min":442.0,"max":1011.0,"sum":3850.0,"value_count":7} | 1419.0
3897+
;

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
@@ -972,6 +972,11 @@ public enum Cap {
972972
*/
973973
AGGREGATE_METRIC_DOUBLE_MV_EXPAND(AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG),
974974

975+
/**
976+
* Registering AggregateMetricDoubleLiteral as a NamedWritable.
977+
*/
978+
AGGREGATE_METRIC_DOUBLE_LITERAL_REGISTERED(AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG),
979+
975980
/**
976981
* Support change point detection "CHANGE_POINT".
977982
*/

0 commit comments

Comments
 (0)