Thursday, August 29, 2013

[Solved] Esper Query Only Generate Insert or ADD event

I have the following Esper query:
SELECT istream column1, column2, column3 
FROM myEventWindow

However, whenever I update any record I always get a ADD event which means in Esper result oldEvent is always null.  What is the problem with my query?

Answer: 

Use irstream instead of istream.  The keyword irstream will include both insert and remove events, that's why it's called irstream.  Change the query to use irstream and my problem is solved. 

SELECT irstream column1, column2, column3 
FROM myEventWindow