lf-edge / ekuiper

Lightweight data stream processing engine for IoT edge
https://ekuiper.org
Apache License 2.0
1.48k stars 416 forks source link

Using sliding window no results output #3350

Open wild-River2016 opened 3 weeks ago

wild-River2016 commented 3 weeks ago

使用滑动窗口(SLIDINGWINDOW)创建温度持续30秒大于75度的规则,没有结果输出。 规则: select temp from stream1 group by SLIDINGWINDOW(ss,30,30) over (when temp > 75) having min(temp) > 75 测试数据: {"deviceId":100,"temp":70.1} {"deviceId":100,"temp":76.1} {"deviceId":100,"temp":77.1} {"deviceId":100,"temp":79.1} {"deviceId":100,"temp":79.1} {"deviceId":100,"temp":79.1} {"deviceId":100,"temp":80.1}

Environment:

What happened and what you expected to happen: 麻烦看一下配置规则是否正确,如何才能输出结果。 期望能得到案例集锦中(总电流持续10s超过200A)的效果。 image

ngjaying commented 3 weeks ago

Having min(temp) > 75 is false. Additionally, SLIDINGWINDOW(ss,30,30) over (when temp > 75) will trigger after 30 seconds. Use SLIDINGWINDOW(ss,30) over (when temp > 75) may be what you want.