有没有办法用 Flux 填充具有 0 个值点的稀疏数据的结果?

Is there a way to fill a result of sparse data with 0 value points with Flux?

我每 5 分钟分配一次点数,当值为 0 时,点数就被忽略了。我想用空值填充省略的数据。

我看到使用 InfluxQL 我可以做到:

group by time(5m) fill(0)

但我使用的是 InfluxDB 2。我试过这个查询:

      from(bucket:"%v")
         |> range(start: %d) 
         |> filter(fn: (r) => r._measurement == "volume" and r.id == "%v")
         |> window(every: 5m, period: 5m, createEmpty: true)
         |> fill(value: 0)

但它似乎不起作用。

感谢任何帮助。

fill() function only replaces nulls in the data and not missing data points based on time. At the moment there's no function available to this time, although one has been requested.

我在需要填充缺失数据的时间段内所做的是生成一个时间序列(具有零值)并将其与具有缺失数据的时间序列连接。

事实证明这是 InfluxDB 中与 https://github.com/influxdata/influxdb/issues/21857

相关的错误

显然 window 功能也不起作用。