elasticsearch/docs/reference/esql/processing-commands
Nik Everett b5c6c2da30
ESQL: INLINESTATS (#109583)
This implements `INLINESTATS`. Most of the heavy lifting is done by
`LOOKUP`, with this change mostly adding a new abstraction to logical
plans, and interface I'm calling `Phased`. Implementing this interface
allows a logical plan node to cut the query into phases. `INLINESTATS`
implements it by asking for a "first phase" that's the same query, up to
`INLINESTATS`, but with `INLINESTATS` replaced with `STATS`. The next
phase replaces the `INLINESTATS` with a `LOOKUP` on the results of the
first phase.

So, this query:
```
FROM foo
| EVAL bar = a * b
| INLINESTATS m = MAX(bar) BY b
| WHERE m = bar
| LIMIT 1
```

gets split into
```
FROM foo
| EVAL bar = a * b
| STATS m = MAX(bar) BY b
```

followed by
```
FROM foo
| EVAL bar = a * b
| LOOKUP (results of m = MAX(bar) BY b) ON b
| WHERE m = bar
| LIMIT 1
```
2024-07-24 17:16:37 -04:00
..
dissect.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
drop.asciidoc ESQL: Move description of commands in docs (#110714) 2024-07-11 08:31:35 -04:00
enrich.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
eval.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
grok.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
inlinestats.asciidoc ESQL: INLINESTATS (#109583) 2024-07-24 17:16:37 -04:00
keep.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
limit.asciidoc ESQL: Move description of commands in docs (#110714) 2024-07-11 08:31:35 -04:00
lookup.asciidoc ESQL: INLINESTATS (#109583) 2024-07-24 17:16:37 -04:00
mv_expand.asciidoc ESQL: Move description of commands in docs (#110714) 2024-07-11 08:31:35 -04:00
rename.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
sort.asciidoc ESQL: Move description of commands in docs (#110714) 2024-07-11 08:31:35 -04:00
stats.asciidoc ESQL: Validate unique plan attribute names (#110488) 2024-07-17 11:39:02 +02:00
where.asciidoc ESQL: Move description of commands in docs (#110714) 2024-07-11 08:31:35 -04:00