siddhi
siddhi copied to clipboard
stdDev() function returns incorrect result in conjunction to #window.length(N)
Description: In conjunction with #window.length(N) the function stdDev() returns non 0 value or NaN when should return 0.
Affected Siddhi Version: 5.1.2
OS, DB, other environment details and versions:
Ubuntu, Docker latest version.
Steps to reproduce: Using this code
@App:name("test")
define stream input (
id string,
value double
);
partition with (id of input)
begin
from input#window.length(3)
select
id,
stdDev(value) as std
insert into tmp;
end;
from tmp#log()
select *
insert into muted;
In editor try to send the following sequence of events a, 1 a, 2 a, 3 a, 3 a, 3 a, 3
stdDev() returns 8.603189426505949E-9 when should 0. It should return 0 because the last three values are 3,3,3 the returning value is not constant, it obviously some accumulated rounding error.
I have tested this on Streaming Integrator which is based on siddhi 5.1.12 and couldn't observe the above behavior.
@AnuGayan which docker images would you recommend to check? I'm using siddhiio/siddhi-tooling:5.1.2
and for running of applications siddhiio/siddhi-runner-base-alpine:5.1.2
I've got multiple errors in my applications related to this. And this case was reproducing pretty stable on tooling 5.1.2
You can try this on Streaming Integrator docker image
I'll check, ok. But shouldn't be a docker image for Enterprise Integrator? As far i I know this is the latest and most fresh version.
Streaming Integrator 1.x.x is a part of Enterprise Integrator 7.x.x offering and SI is the one which is based on Siddhi.