This would probably work, however it wouldn't be reusing the calculations already done after the group by, which was my main intention.
On Tue, Jun 24, 2014 at 6:15 PM, Adam Lewis <[email protected]> wrote: > It sounds like you want a persistentAggregate to occur before the stream > grouping by word, would this work? > in pseudo trident DSL: > > Stream words = ...; > words.groupBy(word).persistentAggregate(...); > words.persistentAggregate(...); > > > On Tue, Jun 24, 2014 at 12:45 PM, Can Gencer <[email protected]> wrote: > >> Hi all, >> >> I'm wondering what is the best way to "chain" persistent aggregations in >> Trident. >> >> Let's say I have a running count of words and I also want to do another >> aggregation to calculate the total count of all words using the results of >> the previous aggregation. >> >> I can use a persistentAggregate to calculate the running total for each >> word. However I can't use another persistentAggregate directly chained to >> that as that would only add the new value instead of decrementing the old >> value for the group first. >> >> What is the best solution to this scenario? Does storm have a way to >> handle this out of the box? >> >> Regards, >> Can >> > >
