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

Implement automatic conversion of aggFun under table model. #464

Merged
merged 8 commits into from
Nov 25, 2024

Conversation

YangYumings
Copy link
Contributor

@YangYumings YangYumings commented Nov 25, 2024

问题

1. 对于Q1,树模型与表模型查询的 device_id 不同;

image

修改后

  • 树模型
    image
  • 表模型
    image

2. 表模型 SQL 中的 sensor 数量比配置文件规定数量少 1;

for 循环中 i 的初始值由 1 改为 0;

3. 对于Q9,Q10,对于表模型 SQL 拼接 “order by device_id, time desc”, 树模型保持 “order by time desc”;

新建 addOrderByTimeDesc() 方法,树表模型分别重写。

4. 表模型自动完成下述 aggFun 的转换:

  • max_time(s1) => last_by(time, s1)
  • min_time(s1) => first_by(time, s1)
  • max_value(s1) => max(s1)
  • min_value(s1) => min(s1)
  • first_value(s1) => first(s1)
  • last_value(s1) => last(s1)
    左侧的 aggFun 表模型不支持,但存在等效的 aggFun 。

5. 两个模型不支持 max_by、min_by,此外表模型不支持 time_duration;

新建 loadAndConvertAggregateFunction() 方法,实现加载配置参数 QUERY_AGGREGATE_FUN 和转换。

在 checkConfig 中添加对上述三种 aggFun 的检查。

Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit d49fe00 into thulab:master Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants