Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据断面聚合 #658

Open
5 of 7 tasks
maikebing opened this issue Mar 22, 2022 · 6 comments
Open
5 of 7 tasks

数据断面聚合 #658

maikebing opened this issue Mar 22, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@maikebing
Copy link
Member

maikebing commented Mar 22, 2022

需求
一天内 一万条数据, 整合成一小时一条, 使用平均的方法, 或者每个小时的最后一条作为依据。
Task<List> LoadTelemetryAsync(Guid deviceId, string keys, DateTime begin, DateTime end, TimeSpan every, Aggregate aggregate);

注意
keys 为空则表示全部,
every 如果是 TimeSpan.Zero表示不适用。aggregate 也不会使用。

@maikebing maikebing added enhancement New feature or request help wanted Extra attention is needed labels Mar 22, 2022
@maikebing
Copy link
Member Author

InfluxDB 中的语法。

from(bucket: "iotsharp")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "TelemetryData")
  |> filter(fn: (r) => r["DeviceId"] == "52958d0c-c462-4644-b91f-a0c4587f898e")
  |> filter(fn: (r) => r["_field"] == "humidity")
  |> aggregateWindow(every: 15m, fn: mean, createEmpty: false)
  |> yield(name: "mean")

maikebing added a commit that referenced this issue Mar 22, 2022
@maikebing
Copy link
Member Author

maikebing commented Mar 22, 2022

下图中, 是每小时 一条是数据。
image

@maikebing
Copy link
Member Author

IoTDB 已经实现。
#726

@maikebing
Copy link
Member Author

修复跟 InfluxDB有关的bug #770

@maikebing maikebing self-assigned this Jul 29, 2022
@iotbi
Copy link

iotbi commented Aug 8, 2022

TimescaleDB实现了么

@maikebing
Copy link
Member Author

TimescaleDB 没实现呢。

@maikebing maikebing added this to the v3.0 milestone Sep 11, 2022
@maikebing maikebing modified the milestones: v3.0, v3.1 May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants