Hej! I have a small problem with my esper code. The input is like that:
t=t.plus(1 seconds)
CondiA ={varible ='Temp', value =1}
t=t.plus(1 seconds)
CondiA ={varible ='Press', value =1}
t=t.plus(1 seconds)
CondiA ={varible ='Speed', value =1}
t=t.plus(1 seconds)
CondiA ={varible ='Temp', value =2}
t=t.plus(1 seconds)
CondiA ={varible ='Press', value =2}
t=t.plus(1 seconds)
CondiA ={varible ='Speed', value =2}
t=t.plus(1 seconds)
CondiA ={varible ='Press', value =1}
t=t.plus(1 seconds)
CondiA ={varible ='Press', value =1}
t=t.plus(1 seconds)
CondiA ={varible ='Temp', value =3}
t=t.plus(1 seconds)
CondiA ={varible ='Press', value =1}
I have one type of Events which has a variable name and a value. I want to detect changes in the values of one specific variable. so I need a select statement which gives me the data at :
I tried diffeent stuff with prior
and prev
but nothing works properly.
This is the most plausible one I made, but it does not give me the results I with for. I tried it with a pattern, but I get a memory overload with @SuppressOverlappingMatches.
select value as x from CondiA#unique(varible) as A where prior(1, A.value) != A.value AND varible = (select varible from CondiA()#lastevent);
If I understand the requirements correctly each "varible" partition is independent and within each value "varible" you need "prior"?
You can do this with a context like so
create context PerVarible partition by varible from CondiA;
context PerVarible select value as x from CondiA where prior(1, A.value) != A.value;
Notes,