Commit e1fc706
PromQL Support in ESQL (elastic#137988)
* Introduce PromQL command
Add PromQL support in ESQL under the PROMQL command.
This commit includes the grammar, associated logical plan and basic
rules for performing translation, from filtering to stats transpilation.
* Grammar
Stand-alone grammar definition and parser, currently 'embedded' inside
ESQL (the current scenario).
Grammar include to pass the valid tests (~200 queries) from Prometheus
3.5; the invalid ones are disabled for now since the parser needs to
validate the syntax using
* Transpilation
Implement basic PromQL plan translation:
Selector → Filter with label matcher conditions
RangeSelector → Filter + Bucket for time bucketing
WithinSeriesAggregate → ESQL function over selector
AcrossSeriesAggregate → TimeSeriesAggregate with groupings
---------
Co-authored-by: Felix Barnsteiner <[email protected]>1 parent 74ff953 commit e1fc706
File tree
88 files changed
+16400
-2915
lines changed- build-tools-internal/src/main/resources
- x-pack/plugin
- esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression
- predicate/operator/arithmetic
- esql
- qa
- server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/generative
- testFixtures/src/main/resources
- promql/grammar
- src
- main
- antlr
- lexer
- parser
- java/org/elasticsearch/xpack/esql
- action
- analysis
- capabilities
- expression/promql
- function
- subquery
- optimizer
- rules/logical/promql
- parser
- promql
- plan/logical
- promql
- operator
- arithmetic
- comparison
- set
- selector
- telemetry
- test/java/org/elasticsearch/xpack/esql
- analysis
- promql
- optimizer
- promql
- rules/logical/promql
- parser/promql
- telemetry
- src/yamlRestTest/resources/rest-api-spec/test/esql
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
88 files changed
+16400
-2915
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| |||
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
232 | 241 | | |
233 | 242 | | |
234 | 243 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
335 | 337 | | |
336 | 338 | | |
337 | 339 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| 350 | + | |
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
| |||
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
387 | 426 | | |
388 | 427 | | |
| 428 | + | |
389 | 429 | | |
390 | 430 | | |
391 | 431 | | |
392 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
393 | 436 | | |
394 | 437 | | |
395 | | - | |
| 438 | + | |
396 | 439 | | |
397 | 440 | | |
398 | 441 | | |
399 | | - | |
| 442 | + | |
400 | 443 | | |
401 | 444 | | |
402 | 445 | | |
403 | 446 | | |
404 | 447 | | |
405 | 448 | | |
406 | 449 | | |
407 | | - | |
| 450 | + | |
408 | 451 | | |
409 | 452 | | |
410 | 453 | | |
411 | | - | |
| 454 | + | |
412 | 455 | | |
413 | 456 | | |
414 | 457 | | |
415 | | - | |
416 | | - | |
| 458 | + | |
| 459 | + | |
417 | 460 | | |
418 | 461 | | |
419 | | - | |
| 462 | + | |
420 | 463 | | |
| 464 | + | |
421 | 465 | | |
422 | 466 | | |
423 | 467 | | |
424 | 468 | | |
425 | 469 | | |
426 | 470 | | |
427 | 471 | | |
428 | | - | |
| 472 | + | |
429 | 473 | | |
430 | 474 | | |
431 | 475 | | |
432 | | - | |
| 476 | + | |
433 | 477 | | |
434 | 478 | | |
435 | 479 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
20 | 39 | | |
21 | 40 | | |
22 | 41 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
135 | 154 | | |
136 | 155 | | |
137 | 156 | | |
| |||
0 commit comments