Commit 59da11b
authored
Support window functions in time-series aggregations (#138139)
This change adds window function support for time-series aggregation
functions including `rate`, `avg_over_time`, and `last_over_time`.
Additional time-series aggregation functions will be supported in a
follow-up to keep this PR focused.
**Examples:**
```js
TS k8s
| WHERE TRANGE("2024-05-10T00:05:00.000Z", "2024-05-10T00:10:00.000Z")
| STATS rate_bytes_in=avg(rate(network.total_bytes_in, 5minute))
BY cluster, time_bucket = bucket(@timestamp, 1minute)
```
Window 5-minute over 1-minute buckets.
```js
TS k8s
| STATS events = sum(avg_over_time(events_received, 10minute))
BY pod, time_bucket = tbucket(5minute)
| SORT time_bucket, pod
| LIMIT 10
```
Window 10-minute over 5-minute buckets.
**Limitation**:
ES|QL currently supports only windows that are multiples of the bucket size.1 parent 860ad79 commit 59da11b
File tree
42 files changed
+887
-78
lines changed- docs
- changelog
- reference/query-languages/esql
- _snippets/functions
- parameters
- types
- images/functions
- kibana/definition/functions
- x-pack/plugin/esql
- compute
- src
- main
- generated-src/org/elasticsearch/compute/aggregation
- java/org/elasticsearch/compute
- aggregation
- blockhash
- operator
- test/java/org/elasticsearch/compute/aggregation
- test/src/main/java/org/elasticsearch/compute/test
- qa/testFixtures/src/main/resources
- src
- main/java/org/elasticsearch/xpack/esql
- action
- expression/function
- aggregate
- optimizer/rules/logical
- planner
- plan/logical
- test/java/org/elasticsearch/xpack/esql
- expression/function/aggregate
- optimizer
- planner
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+887
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
0 commit comments