Search code examples
eventstwitter4jesper

Check Data with Esper + Twitter4J


I am using Esper with Twitter4J to process Data from the Twitterstream. Now I want to compare current Data with all Data from the last 10 seconds. I want to check, if someone posts two or more Tweets in a time slice of 10 seconds. Whats Statement for such a check? Or do you check such outside of the Esper Statement?

My statement is right now:

String expression = "select user, sum(ctr) from Tweet.win:time(10 seconds) having user IN (select user from Tweet.win:time(10 seconds))";

I know that this is wrong, because two identical variables are being compared, but i don't know how to check, if the same user was ound in the last 10 seconds...

I appreciate any help.


Solution

  • I've figured it out, it must be:

    select user, count(user), text from Tweet.win:time(1sec) group by user having (count(user) > 1)