influxdata / influxdata/influxdb
Create a planner rule to rewrite window group aggregate mean calls
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
This depends on #18862.
Rewrite any call to `group(...) |> window |> mean()` with something like the following:
```
ReadWindowAggregate(count, sum) |> group(columns: ["_start", "_stop", columns...]) |> sum(columns: ["sum", "count"]) |> map(fn: (r) => ({r with _value: float(v: r.sum) / float(v: r.count)}))
```
The `ReadWindowAggregate` call, which the output of is not designed yet, will return the aggregates together and they can be grouped and summed to be combined using a `map` call to find the mean of each windowed group.
Contributor guide
Research direction
Begin with dependent issue #18862, then locate the planner rule entry point for rewriting group |> window |> mean() calls. The output shape for ReadWindowAggregate is not yet designed, so completion requires defining that interface and confirming the rewrite combines aggregates into the stated mean calculation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100