Skip to content

Commit 26a95cb

Browse files
authored
ESQL: Support exponential histograms in TS queries (#138563)
1 parent ba64f40 commit 26a95cb

File tree

20 files changed

+478
-68
lines changed

20 files changed

+478
-68
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,11 @@ protected boolean supportsExponentialHistograms() {
430430
try {
431431
return RestEsqlTestCase.hasCapabilities(
432432
client(),
433-
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V4.capabilityName())
433+
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V5.capabilityName())
434434
)
435435
&& RestEsqlTestCase.hasCapabilities(
436436
remoteClusterClient(),
437-
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V4.capabilityName())
437+
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V5.capabilityName())
438438
);
439439
} catch (IOException e) {
440440
throw new RuntimeException(e);

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlSpecIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected boolean supportsSourceFieldMapping() {
5858
protected boolean supportsExponentialHistograms() {
5959
return RestEsqlTestCase.hasCapabilities(
6060
client(),
61-
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V4.capabilityName())
61+
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V5.capabilityName())
6262
);
6363
}
6464

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ protected boolean supportsSourceFieldMapping() throws IOException {
289289
protected boolean supportsExponentialHistograms() {
290290
return RestEsqlTestCase.hasCapabilities(
291291
client(),
292-
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V4.capabilityName())
292+
List.of(EsqlCapabilities.Cap.EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V5.capabilityName())
293293
);
294294
}
295295

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/CsvTestsDataLoader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ public class CsvTestsDataLoader {
172172
private static final TestDataset DENSE_VECTOR = new TestDataset("dense_vector");
173173
private static final TestDataset COLORS = new TestDataset("colors");
174174
private static final TestDataset COLORS_CMYK_LOOKUP = new TestDataset("colors_cmyk").withSetting("lookup-settings.json");
175-
private static final TestDataset EXP_HISTO_SAMPLE = new TestDataset("exp_histo_sample");
175+
private static final TestDataset EXP_HISTO_SAMPLE = new TestDataset(
176+
"exp_histo_sample",
177+
"exp_histo_sample-mappings.json",
178+
"exp_histo_sample.csv"
179+
).withSetting("exp_histo_sample-settings.json");
176180

177181
public static final Map<String, TestDataset> CSV_DATASET_MAP = Map.ofEntries(
178182
Map.entry(EMPLOYEES.indexName, EMPLOYEES),

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@timestamp:date,instance:keyword,responseTime:exponential_histogram
2-
2025-01-01T00:00:00Z,dummy-empty,{"scale":-7}
3-
2025-01-01T00:00:00Z,dummy-full,{"scale":0\,"sum":-3775.0\,"min":-100.0\,"max":50.0\,"zero":{"count":1\,"threshold":1.0E-4}\,"positive":{"indices":[-1\,0\,1\,2\,3\,4\,5]\,"counts":[1\,1\,2\,4\,8\,16\,18]}\,"negative":{"indices":[-1\,0\,1\,2\,3\,4\,5\,6]\,"counts":[1\,1\,2\,4\,8\,16\,32\,36]}}
4-
2025-01-01T00:00:00Z,dummy-no_zero_bucket,{"scale":0\,"sum":-3775.0\,"min":-100.0\,"max":50.0\,"positive":{"indices":[-1\,0\,1\,2\,3\,4\,5]\,"counts":[1\,1\,2\,4\,8\,16\,18]}\,"negative":{"indices":[-1\,0\,1\,2\,3\,4\,5\,6]\,"counts":[1\,1\,2\,4\,8\,16\,32\,36]}}
5-
2025-01-01T00:00:00Z,dummy-positive_only,{"scale":2\,"sum":1275.0\,"min":1.0\,"max":50.0\,"positive":{"indices":[-1\,3\,6\,7\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22]\,"counts":[1\,1\,1\,1\,1\,1\,2\,1\,2\,2\,3\,3\,3\,4\,6\,6\,7\,5]}}
6-
2025-01-01T00:00:00Z,dummy-negative_only,{"scale":2\,"sum":-1275.0\,"min":-50.0\,"max":-1.0\,"negative":{"indices":[-1\,3\,6\,7\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22]\,"counts":[1\,1\,1\,1\,1\,1\,2\,1\,2\,2\,3\,3\,3\,4\,6\,6\,7\,5]}}
7-
2025-01-01T00:00:00Z,dummy-zero_threshold_only,{"scale":0\,"zero":{"threshold":2.0E-5}}
8-
2025-01-01T00:00:00Z,dummy-zero_count_only,{"scale":2\,"min":0\,"max":0\,"zero":{"count":101}}
2+
2025-09-24T00:00:00Z,dummy-empty,{"scale":-7}
3+
2025-09-24T00:00:00Z,dummy-full,{"scale":0\,"sum":-3775.0\,"min":-100.0\,"max":50.0\,"zero":{"count":1\,"threshold":1.0E-4}\,"positive":{"indices":[-1\,0\,1\,2\,3\,4\,5]\,"counts":[1\,1\,2\,4\,8\,16\,18]}\,"negative":{"indices":[-1\,0\,1\,2\,3\,4\,5\,6]\,"counts":[1\,1\,2\,4\,8\,16\,32\,36]}}
4+
2025-09-24T00:00:00Z,dummy-no_zero_bucket,{"scale":0\,"sum":-3775.0\,"min":-100.0\,"max":50.0\,"positive":{"indices":[-1\,0\,1\,2\,3\,4\,5]\,"counts":[1\,1\,2\,4\,8\,16\,18]}\,"negative":{"indices":[-1\,0\,1\,2\,3\,4\,5\,6]\,"counts":[1\,1\,2\,4\,8\,16\,32\,36]}}
5+
2025-09-24T00:00:00Z,dummy-positive_only,{"scale":2\,"sum":1275.0\,"min":1.0\,"max":50.0\,"positive":{"indices":[-1\,3\,6\,7\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22]\,"counts":[1\,1\,1\,1\,1\,1\,2\,1\,2\,2\,3\,3\,3\,4\,6\,6\,7\,5]}}
6+
2025-09-24T00:00:00Z,dummy-negative_only,{"scale":2\,"sum":-1275.0\,"min":-50.0\,"max":-1.0\,"negative":{"indices":[-1\,3\,6\,7\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22]\,"counts":[1\,1\,1\,1\,1\,1\,2\,1\,2\,2\,3\,3\,3\,4\,6\,6\,7\,5]}}
7+
2025-09-24T00:00:00Z,dummy-zero_threshold_only,{"scale":0\,"zero":{"threshold":2.0E-5}}
8+
2025-09-24T00:00:00Z,dummy-zero_count_only,{"scale":2\,"min":0\,"max":0\,"zero":{"count":101}}
99
2025-09-25T00:01:00Z,instance-2,{"scale":4\,"sum":0.10814399999999999\,"min":2.65E-4\,"max":0.067933\,"positive":{"indices":[-191\,-188\,-184\,-182\,-181\,-180\,-179\,-178\,-176\,-175\,-172\,-171\,-170\,-169\,-168\,-167\,-152\,-150\,-149\,-137\,-131\,-112\,-110\,-63]\,"counts":[1\,1\,1\,2\,2\,5\,2\,1\,1\,1\,1\,1\,1\,2\,3\,1\,1\,1\,1\,1\,1\,1\,1\,1]}}
1010
2025-09-25T00:01:00Z,instance-0,{"scale":3\,"sum":9.269670999999999\,"min":3.79E-4\,"max":0.873616\,"positive":{"indices":[-91\,-90\,-88\,-87\,-86\,-85\,-84\,-83\,-82\,-77\,-76\,-75\,-73\,-72\,-66\,-65\,-63\,-61\,-58\,-55\,-54\,-53\,-51\,-49\,-46\,-44\,-43\,-38\,-35\,-31\,-30\,-24\,-23\,-22\,-21\,-19\,-17\,-16\,-15\,-14\,-13\,-10\,-9\,-8\,-5\,-4\,-2]\,"counts":[2\,2\,1\,6\,2\,1\,1\,1\,1\,2\,1\,3\,1\,1\,1\,1\,1\,1\,2\,1\,1\,1\,1\,2\,1\,2\,1\,2\,1\,1\,1\,1\,1\,1\,1\,1\,1\,2\,1\,3\,2\,2\,2\,1\,1\,2\,1]}}
1111
2025-09-25T00:01:00Z,instance-1,{"scale":4\,"sum":0.149232\,"min":2.58E-4\,"max":0.061096\,"positive":{"indices":[-191\,-183\,-182\,-181\,-180\,-179\,-177\,-175\,-174\,-172\,-171\,-168\,-167\,-166\,-155\,-153\,-151\,-150\,-148\,-113\,-66\,-65]\,"counts":[1\,1\,3\,2\,2\,1\,1\,4\,1\,1\,1\,1\,2\,1\,1\,1\,3\,1\,1\,1\,1\,1]}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"properties": {
3+
"@timestamp": {
4+
"type": "date"
5+
},
6+
"instance": {
7+
"type": "keyword",
8+
"time_series_dimension": true
9+
},
10+
"responseTime": {
11+
"type": "exponential_histogram",
12+
"time_series_metric": "histogram"
13+
}
14+
}
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"index": {
3+
"mode": "time_series",
4+
"routing_path": ["instance"],
5+
"time_series": {
6+
"start_time": "2025-09-24T00:00:00Z",
7+
"end_time": "2025-09-26T00:00:00Z"
8+
}
9+
}
10+
}

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

Lines changed: 108 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
loadFiltered
2-
required_capability: exponential_histogram_pre_tech_preview_v4
2+
required_capability: exponential_histogram_pre_tech_preview_v5
33

44
FROM exp_histo_sample | WHERE STARTS_WITH(instance, "dummy") | SORT instance | KEEP instance, responseTime
55
;
@@ -14,10 +14,8 @@ dummy-zero_count_only | "{""scale"":2,""sum"":0.0,""min"":0.0,""max"":0.0,""
1414
dummy-zero_threshold_only | "{""scale"":0,""zero"":{""threshold"":2.0E-5}}"
1515
;
1616

17-
18-
1917
allAggsGrouped
20-
required_capability: exponential_histogram_pre_tech_preview_v4
18+
required_capability: exponential_histogram_pre_tech_preview_v5
2119

2220
FROM exp_histo_sample
2321
| EVAL instance = CASE(STARTS_WITH(instance, "dummy"), "dummy-grouped", instance)
@@ -36,7 +34,7 @@ instance-2 | 2.2E-4 | 2.744054 | 6.469E-4 | 0.0016068 | 27.706
3634

3735

3836
allAggsFiltered
39-
required_capability: exponential_histogram_pre_tech_preview_v4
37+
required_capability: exponential_histogram_pre_tech_preview_v5
4038

4139
FROM exp_histo_sample
4240
| STATS min = MIN(responseTime) WHERE instance == "instance-0",
@@ -55,7 +53,7 @@ min:double | max:double | median:double | p75:double | sum:double | avg:double
5553

5654

5755
allAggsGroupedFiltered
58-
required_capability: exponential_histogram_pre_tech_preview_v4
56+
required_capability: exponential_histogram_pre_tech_preview_v5
5957

6058
FROM exp_histo_sample
6159
| WHERE NOT STARTS_WITH(instance, "dummy")
@@ -79,7 +77,7 @@ instance-2 | null | null | 6.469E-4 | null | null
7977

8078

8179
allAggsGroupedEmptyGroups
82-
required_capability: exponential_histogram_pre_tech_preview_v4
80+
required_capability: exponential_histogram_pre_tech_preview_v5
8381

8482
FROM exp_histo_sample
8583
| STATS min = MIN(responseTime) WHERE instance == "idontexist",
@@ -96,7 +94,7 @@ null | null | null | null | null | null
9694
;
9795

9896
allAggsInlineGrouped
99-
required_capability: exponential_histogram_pre_tech_preview_v4
97+
required_capability: exponential_histogram_pre_tech_preview_v5
10098

10199
FROM exp_histo_sample
102100
| INLINE STATS min = MIN(responseTime), max = MAX(responseTime), median = MEDIAN(responseTime), p75 = PERCENTILE(responseTime,75), sum = SUM(responseTime), avg = AVG(responseTime) BY instance
@@ -127,7 +125,7 @@ instance-0 | 2.4E-4 | 6.786232 | 0.0211404 | 0.2608237
127125

128126

129127
allAggsOnEmptyHistogram
130-
required_capability: exponential_histogram_pre_tech_preview_v4
128+
required_capability: exponential_histogram_pre_tech_preview_v5
131129

132130
FROM exp_histo_sample | WHERE instance == "dummy-empty"
133131
| STATS min = MIN(responseTime), max = MAX(responseTime), median = MEDIAN(responseTime), p75 = PERCENTILE(responseTime,75), sum = SUM(responseTime), avg = AVG(responseTime)
@@ -140,7 +138,7 @@ NULL | NULL | NULL | NULL | NULL | NULL
140138

141139

142140
histoAsCaseValue
143-
required_capability: exponential_histogram_pre_tech_preview_v4
141+
required_capability: exponential_histogram_pre_tech_preview_v5
144142

145143
FROM exp_histo_sample
146144
| INLINE STATS p50 = PERCENTILE(responseTime, 50) BY instance, @timestamp
@@ -154,7 +152,7 @@ filteredCount:long
154152
;
155153

156154
ungroupedPercentiles
157-
required_capability: exponential_histogram_pre_tech_preview_v4
155+
required_capability: exponential_histogram_pre_tech_preview_v5
158156

159157
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
160158
| STATS p0 = PERCENTILE(responseTime,0), p50 = PERCENTILE(responseTime,50), p99 = PERCENTILE(responseTime, 99), p100 = PERCENTILE(responseTime,100)
@@ -169,7 +167,7 @@ p0:double | p50:double | p99:double | p100:double
169167

170168

171169
groupedPercentiles
172-
required_capability: exponential_histogram_pre_tech_preview_v4
170+
required_capability: exponential_histogram_pre_tech_preview_v5
173171

174172
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
175173
| STATS p0 = PERCENTILE(responseTime,0), p50 = PERCENTILE(responseTime,50), p99 = PERCENTILE(responseTime, 99), p100 = PERCENTILE(responseTime,100) BY instance
@@ -187,7 +185,7 @@ instance-2 | 2.2E-4 | 6.469E-4 | 0.0857672 | 2.7059714542564097
187185

188186

189187
percentileOnEmptyHistogram
190-
required_capability: exponential_histogram_pre_tech_preview_v4
188+
required_capability: exponential_histogram_pre_tech_preview_v5
191189

192190
FROM exp_histo_sample | WHERE instance == "dummy-empty"
193191
| STATS p50 = PERCENTILE(responseTime,50)
@@ -201,7 +199,7 @@ NULL
201199

202200

203201
ungroupedMinMax
204-
required_capability: exponential_histogram_pre_tech_preview_v4
202+
required_capability: exponential_histogram_pre_tech_preview_v5
205203

206204
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
207205
| STATS min = MIN(responseTime), max = MAX(responseTime)
@@ -215,7 +213,7 @@ min:double | max:double
215213

216214

217215
groupedMinMax
218-
required_capability: exponential_histogram_pre_tech_preview_v4
216+
required_capability: exponential_histogram_pre_tech_preview_v5
219217

220218
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
221219
| STATS min = MIN(responseTime), max = MAX(responseTime) BY instance
@@ -232,7 +230,7 @@ instance-2 | 2.2E-4 | 2.744054
232230

233231

234232
minMaxOnEmptyHistogram
235-
required_capability: exponential_histogram_pre_tech_preview_v4
233+
required_capability: exponential_histogram_pre_tech_preview_v5
236234

237235
FROM exp_histo_sample | WHERE instance == "dummy-empty"
238236
| STATS min = MIN(responseTime), max = MAX(responseTime)
@@ -245,7 +243,7 @@ NULL | NULL
245243

246244

247245
ungroupedAvg
248-
required_capability: exponential_histogram_pre_tech_preview_v4
246+
required_capability: exponential_histogram_pre_tech_preview_v5
249247

250248
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
251249
| STATS avg = ROUND(AVG(responseTime), 7) // rounding to avoid floating point precision issues
@@ -258,7 +256,7 @@ avg:double
258256

259257

260258
groupedAvg
261-
required_capability: exponential_histogram_pre_tech_preview_v4
259+
required_capability: exponential_histogram_pre_tech_preview_v5
262260

263261
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
264262
| STATS avg = ROUND(AVG(responseTime), 7) BY instance // rounding to avoid floating point precision issues
@@ -274,7 +272,7 @@ instance-2 | 0.008197
274272

275273

276274
avgOnEmptyHistogram
277-
required_capability: exponential_histogram_pre_tech_preview_v4
275+
required_capability: exponential_histogram_pre_tech_preview_v5
278276

279277
FROM exp_histo_sample | WHERE instance == "dummy-empty"
280278
| STATS avg = AVG(responseTime)
@@ -287,7 +285,7 @@ NULL
287285

288286

289287
ungroupedSum
290-
required_capability: exponential_histogram_pre_tech_preview_v4
288+
required_capability: exponential_histogram_pre_tech_preview_v5
291289

292290
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
293291
| STATS sum = ROUND(SUM(responseTime), 7) // rounding to avoid floating point precision issues
@@ -300,7 +298,7 @@ sum:double
300298

301299

302300
groupedSum
303-
required_capability: exponential_histogram_pre_tech_preview_v4
301+
required_capability: exponential_histogram_pre_tech_preview_v5
304302

305303
FROM exp_histo_sample | WHERE NOT STARTS_WITH(instance, "dummy")
306304
| STATS sum = ROUND(SUM(responseTime), 7) BY instance // rounding to avoid floating point precision issues
@@ -313,3 +311,92 @@ instance-0 | 1472.744209
313311
instance-1 | 36.198484
314312
instance-2 | 27.706021
315313
;
314+
315+
316+
timeseriesAllAggsNoBucket
317+
required_capability: exponential_histogram_pre_tech_preview_v5
318+
required_capability: ts_command_v0
319+
320+
TS exp_histo_sample
321+
| WHERE NOT STARTS_WITH(instance, "dummy")
322+
| STATS min = MIN(responseTime), max = MAX(responseTime), median = MEDIAN(responseTime), p75 = PERCENTILE(responseTime,75), sum = SUM(responseTime), avg = AVG(responseTime) BY instance
323+
| EVAL median = ROUND(median, 7), p75 = ROUND(p75, 7), sum = ROUND(sum, 7), avg = ROUND(avg, 7) // rounding to avoid floating point precision issues
324+
| KEEP instance, min, max, median, p75, sum, avg
325+
| SORT instance
326+
;
327+
328+
instance:keyword | min:double | max:double | median:double | p75:double | sum:double | avg:double
329+
instance-0 | 2.4E-4 | 6.786232 | 0.0211404 | 0.2608237 | 1472.744209 | 0.1665812
330+
instance-1 | 2.17E-4 | 3.190723 | 6.469E-4 | 0.0016068 | 36.198484 | 0.011138
331+
instance-2 | 2.2E-4 | 2.744054 | 6.469E-4 | 0.0016068 | 27.706021 | 0.008197
332+
;
333+
334+
335+
timeseriesAllAggsFilteredAndBucketed
336+
required_capability: exponential_histogram_pre_tech_preview_v5
337+
required_capability: ts_command_v0
338+
339+
TS exp_histo_sample
340+
| WHERE NOT STARTS_WITH(instance, "dummy")
341+
| WHERE TRANGE(to_datetime("2025-09-25T00:30:00Z"), to_datetime("2025-09-25T01:00:00Z"))
342+
| STATS min = MIN(responseTime), max = MAX(responseTime), median = MEDIAN(responseTime), p75 = PERCENTILE(responseTime,75), sum = SUM(responseTime), avg = AVG(responseTime) BY instance, time=TBUCKET(10m)
343+
| EVAL median = ROUND(median, 7), p75 = ROUND(p75, 7), sum = ROUND(sum, 7), avg = ROUND(avg, 7) // rounding to avoid floating point precision issues
344+
| KEEP instance, time, min, max, median, p75, sum, avg
345+
| SORT instance, time
346+
;
347+
348+
instance:keyword | time:datetime | min:double | max:double | median:double | p75:double | sum:double | avg:double
349+
instance-0 | 2025-09-25T00:30:00.000Z | 2.5E-4 | 1.291403 | 0.0274157 | 0.2391763 | 128.220162 | 0.1582965
350+
instance-0 | 2025-09-25T00:40:00.000Z | 2.93E-4 | 1.381711 | 0.013139 | 0.2193257 | 139.229386 | 0.1567898
351+
instance-0 | 2025-09-25T00:50:00.000Z | 2.57E-4 | 1.337726 | 0.029897 | 0.2608237 | 146.914416 | 0.1680943
352+
instance-0 | 2025-09-25T01:00:00.000Z | 3.58E-4 | 1.384036 | 0.017812 | 0.1665956 | 15.216617 | 0.1729161
353+
instance-1 | 2025-09-25T00:30:00.000Z | 2.37E-4 | 0.144625 | 6.831E-4 | 0.0015387 | 1.323601 | 0.0046119
354+
instance-1 | 2025-09-25T00:40:00.000Z | 2.33E-4 | 0.189058 | 5.681E-4 | 0.0014734 | 1.422738 | 0.0049746
355+
instance-1 | 2025-09-25T00:50:00.000Z | 2.29E-4 | 0.06199 | 5.681E-4 | 0.001411 | 0.737455 | 0.0025695
356+
instance-1 | 2025-09-25T01:00:00.000Z | 3.31E-4 | 0.252402 | 7.055E-4 | 0.0015898 | 0.399745 | 0.0133248
357+
instance-2 | 2025-09-25T00:30:00.000Z | 2.21E-4 | 0.136683 | 6.469E-4 | 0.0015727 | 1.710478 | 0.0057982
358+
instance-2 | 2025-09-25T00:40:00.000Z | 2.25E-4 | 0.098632 | 5.932E-4 | 0.001411 | 1.278917 | 0.0041255
359+
instance-2 | 2025-09-25T00:50:00.000Z | 2.2E-4 | 0.092109 | 5.807E-4 | 0.0014578 | 0.946027 | 0.0032622
360+
instance-2 | 2025-09-25T01:00:00.000Z | 2.45E-4 | 0.008362 | 4.777E-4 | 6.756E-4 | 0.033433 | 0.0011529
361+
;
362+
363+
364+
timeseriesAllAggsUngrouped
365+
required_capability: exponential_histogram_pre_tech_preview_v5
366+
required_capability: ts_command_v0
367+
368+
TS exp_histo_sample
369+
| WHERE NOT STARTS_WITH(instance, "dummy")
370+
| STATS min = MIN(responseTime), max = MAX(responseTime), median = MEDIAN(responseTime), p75 = PERCENTILE(responseTime,75), sum = SUM(responseTime), avg = AVG(responseTime)
371+
| EVAL median = ROUND(median, 7), p75 = ROUND(p75, 7), sum = ROUND(sum, 7), avg = ROUND(avg, 7) // rounding to avoid floating point precision issues
372+
| KEEP min, max, median, p75, sum, avg
373+
;
374+
375+
min:double | max:double | median:double | p75:double | sum:double | avg:double
376+
2.17E-4 | 6.786232 | 0.0016965 | 0.0542885 | 1536.648714 | 0.0993245
377+
;
378+
379+
380+
timseriesAllAggsGroupedFiltered
381+
required_capability: exponential_histogram_pre_tech_preview_v5
382+
required_capability: ts_command_v0
383+
384+
TS exp_histo_sample
385+
| WHERE NOT STARTS_WITH(instance, "dummy")
386+
| STATS min = MIN(responseTime) WHERE instance == "instance-0",
387+
max = MAX(responseTime) WHERE instance == "instance-1",
388+
median = MEDIAN(responseTime) WHERE instance == "instance-2",
389+
p75 = PERCENTILE(responseTime,75) WHERE instance == "instance-0",
390+
sum = SUM(responseTime) WHERE instance == "instance-1",
391+
avg = AVG(responseTime) WHERE instance == "instance-2"
392+
BY instance
393+
| EVAL median = ROUND(median, 7), p75 = ROUND(p75, 7), sum = ROUND(sum, 7), avg = ROUND(avg, 7) // rounding to avoid floating point precision issues
394+
| KEEP instance, min, max, median, p75, sum, avg
395+
| SORT instance
396+
;
397+
398+
instance:keyword | min:double | max:double | median:double | p75:double | sum:double | avg:double
399+
instance-0 | 2.4E-4 | null | null | 0.2608237 | null | null
400+
instance-1 | null | 3.190723 | null | null | 36.198484 | null
401+
instance-2 | null | null | 6.469E-4 | null | null | 0.008197
402+
;

x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-exp_histo_sample.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ public enum Cap {
15721572
* When implementing changes on this type, we'll simply increment the version suffix at the end to prevent bwc tests from running.
15731573
* As soon as we move into tech preview, we'll replace this capability with a "EXPONENTIAL_HISTOGRAM_TECH_PREVIEW" one.
15741574
*/
1575-
EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V4(EXPONENTIAL_HISTOGRAM_FEATURE_FLAG),
1575+
EXPONENTIAL_HISTOGRAM_PRE_TECH_PREVIEW_V5(EXPONENTIAL_HISTOGRAM_FEATURE_FLAG),
15761576

15771577
/**
15781578
* Create new block when filtering OrdinalBytesRefBlock

0 commit comments

Comments
 (0)