Influxdb2 Fields displayed in a measurement in different time ranges are different


import “timezone”
import “date”

from(bucket: “hinaiot”)
|> range(start: 2024-03-07T00:00:00+08:00, stop: 2024-03-07T23:59:59+08:00)
|> filter(fn: (r) => r._measurement == “pcsmeas”)
|> filter(fn: (r) => r.clientName == “1734496065552486402_cntest”)
|> aggregateWindow(every: 1d, fn: max, createEmpty: true,location: timezone.location(name: “Asia/Shanghai”))
|>yield()
the result have 23 tables. but when i only change start time
import “timezone”
import “date”

from(bucket: “hinaiot”)
|> range(start: 2023-03-07T00:00:00+08:00, stop: 2024-03-07T23:59:59+08:00)
|> filter(fn: (r) => r._measurement == “pcsmeas”)
|> filter(fn: (r) => r.clientName == “1734496065552486402_cntest”)
|> aggregateWindow(every: 1d, fn: max, createEmpty: true,location: timezone.location(name: “Asia/Shanghai”))
|>yield()
the result is only 4 tables

is influxql have some bug?


the second result

Hello @xiaopengshinidie
Sorry for the delay. I was out of office.

Time Range Difference: The first query covers a single day (2024-03-07), while the second spans over a year (2023-03-07 to 2024-03-07). The range function limits the time period of the data to be considered for processing. It looks like the second picture is the one returning more results.