简体   繁体   中英

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.

I do the same for the avg but I always get 0 once all the events expire from the 1 minute time window.

Thanks for letting us know the inconsistent behavior, based on SQL it should return null. We have made fixes such that avg(), min(), max(), and sum() to return null when no events in the table[1].

Do use default() or ifThenElse() with "is null" to convert null to extected default value if needed.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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