0

Siddhi 3.1.0, my siddhiql like this:

define stream demo(key string, v1 int, v2 int, v3 int);
from demo#window.cron(0/5 * * * * ?)
select key,sum(v1) as v1,sum(v2) as v2,sum(v3) as v3 insert into outputStream

I expect to get the result aggregations for the key key group, actually I receive one aggregated result per event but not one per group. I know timeBatch can get result per group, but it can't control the output time period. Any suggestion?

alphacome
  • 1
  • 2

1 Answers1

0

You should use GroupBy clause.

from demo#window.cron(0/5 * * * * ?)
select key,sum(v1) as v1,sum(v2) as v2,sum(v3) as v3 
group by key
insert into outputStream;
Grainier
  • 1,634
  • 2
  • 17
  • 30