real time - How to make esper epl divide section and compare value -
i new using esper
. don't know esper epl
, i'm in trouble.
problem this.
user define value section.
for example, level1 : 1~3 level2 : 4~6 level3 : 7~9
so when data come first, check section , make events. previous value , new value same level nothing (ex. prev value=1, next value=2 these in same level1)
.
in other words, when data come, check previous value , level. if have different level, something.
esper epl can this? how can make it?
the "prior" , "prev" both give access event before given event. sql standard "case when then" if-then-else of sql standard. this:
insert categorizedstream select case when value between 1 , 3 1 when value between 4 , 6 2 when value > 6 3 end level someevent; select * categorizedstream(prior(level) != level);
one use prior , case-when in 1 epl statement think becomes more readable using 2 statements.
Comments
Post a Comment