Hi,
we have an issue that aggregateWindow for month doesn’t work correctly with negative offset.
For zero offset it works fine, and for the following query
`
from(bucket: “my_bucket”) |> range(start: 2021-01-24T14:10:31+02:00, stop: 2021-12-24T14:10:31+02:00) |> filter(fn: (r) => r._measurement == “my_measurement”) |> filter(fn: (r) => r.machine == “123”) |> filter(fn: (r) => r._field == “span”) |> filter(fn: (r) => r.state == “working”) |> aggregateWindow(every: 1mo, offset: 0s, fn: sum, createEmpty: true ) |> yield(name: “sum”)
`
in the received result the _time column looks like this:
- 2021-02-01T00:00:00.000Z
- 2021-03-01T00:00:00.000Z
- 2021-04-01T00:00:00.000Z
- 2021-05-01T00:00:00.000Z
- 2021-06-01T00:00:00.000Z
- 2021-07-01T00:00:00.000Z
- 2021-08-01T00:00:00.000Z
- 2021-09-01T00:00:00.000Z
- 2021-10-01T00:00:00.000Z
- 2021-11-01T00:00:00.000Z
- 2021-01-24T12:10:31.000Z
But when negative offset is used (we keep data in DB in UTC and shift them in query), the query is
`
from(bucket: “my_bucket”) |> range(start: 2021-01-24T14:10:31+02:00, stop: 2021-12-24T14:10:31+02:00) |> filter(fn: (r) => r._measurement == “my_measurement”) |> filter(fn: (r) => r.machine == “123”) |> filter(fn: (r) => r._field == “span”) |> filter(fn: (r) => r.state == “working”) |> aggregateWindow(every: 1mo, offset: -7200s, fn: sum, createEmpty: true ) |> yield(name: “sum”)
`
then the _time column in the received result looks broken:
- 2021-01-31T22:00:00.000Z
- 2021-02-28T22:00:00.000Z
- 2021-03-28T22:00:00.000Z
- 2021-04-30T22:00:00.000Z
- 2021-05-30T22:00:00.000Z
- 2021-06-30T22:00:00.000Z
- 2021-07-30T22:00:00.000Z
- 2021-08-31T22:00:00.000Z
- 2021-09-30T22:00:00.000Z
- 2021-10-30T22:00:00.000Z
- 2021-11-30T22:00:00.000Z
- 2021-12-24T14:10:31.000Z
What we want is to aggregate data by month with possibility to shift the data according to a certain timezone.
Are we doing something wrong?
Thank you
Used InfluxDB version is 2.0.7