简体   繁体   English

WSO2 CEP-SIDDHI max函数在时间窗口中返回null

[英]WSO2 CEP - SIDDHI max function in time window returns null

I have a query that captures the max value of a field in a stream: 我有一个查询,它捕获流中字段的最大值:

from stream1#window.time(1 min)
select max(value1) as max_value1 
insert all events into newstream;

Although, after this window I start to get null values in the max_value1. 尽管在此窗口之后,我开始在max_value1中获取空值。

I do the same for the avg but I always get 0 once all the events expire from the 1 minute time window. 我对平均值进行相同的操作,但是一旦所有事件在1分钟的时间窗口内过期,我总是得到0。

Thanks for letting us know the inconsistent behavior, based on SQL it should return null. 感谢您让我们知道不一致的行为,基于SQL,它应该返回null。 We have made fixes such that avg(), min(), max(), and sum() to return null when no events in the table[1]. 我们进行了修复,例如当table [1]中没有事件时,avg(),min(),max()和sum()返回null。

Do use default() or ifThenElse() with "is null" to convert null to extected default value if needed. 如果需要,请使用default()或ifThenElse()与“ is null”将null转换为扩展的默认值。

[1] https://github.com/wso2/siddhi/pull/344 [1] https://github.com/wso2/siddhi/pull/344

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM