influxdata / influxdata/influxdb
aggregateWindow uses wrong _start and _stop values
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Without `aggregateWindow`

After applying `aggregateWindow`

Here's a simple exampel of `aggregateWindow` compleetly fucking up the data
```
import "array"
import "date"
d = array.from(rows: [
{_time: 2023-01-01T00:00:00Z, _value: 1},
{_time: 2023-02-01T00:00:00Z, _value: 2},
{_time: 2023-03-01T00:00:00Z, _value: 3}
])
d
|> range(start: 2023-01-01T00:00:00Z, stop: 2023-05-01T00:00:00Z)
|> map(fn: (r) => ({
_start: 2023-04-01T00:00:00Z,
_stop: 2023-04-30T00:00:00Z,
_time: date.add(d: duration(v: string(v: r._value) + "d"), to: 2023-04-10T00:00:00Z),
_value: r._value
}))
|> aggregateWindow(every: 1mo, fn: count)
|> yield()
```
Contributor guide
Research direction
Start by running the supplied Flux query and inspecting the aggregateWindow entry point and its handling of _start and _stop. Trace why the reported window metadata is produced, then add a regression test for this example and confirm the resulting values match the intended window boundaries.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100