-1

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.

  • Unfortunately, Stackoverflow is not for getting people to help you before you've written any code, only to help you figure out problems in your code after you wrote it, and can't figure out why it doesn't do what you think it should do - Instead, I can recommend reading through a few articles on how to use Processing (the Processing website has some good tutorials for that) and which constructions you can do to cache values, compare them to other values, etc. – Mike 'Pomax' Kamermans Mar 25 '15 at 16:46
  • Does this question have anything to do with the Processing language? If not, it shouldn't use the [tag:processing] tag. – Kevin Workman Mar 25 '15 at 16:51
  • Wouldn't it just be this: select user, sum(ctr) from Tweet.win:time(10 seconds) having count(*) > 2 – user650839 Mar 26 '15 at 12:56
  • almost, you have to add the group by-caluse as in my Answer –  Mar 27 '15 at 11:07

1 Answers1

0

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)