You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by 陆雯斌 <lu...@126.com> on 2015/07/24 17:20:53 UTC

Chained Aggregate persistent aggregation to multiple columns in a single row

|   |
|
Dear all,


I have some tuple structure like (c1,c2,c3,c4,c5,c6), can I do something and transform the tuples and persist into a single row (c1,c2,c3,sum(c4),count(*),sum(c6)).
I check some doc and seems the chainAgg might help.


groupby(new Fields(c1,c2,c3))
stream.chainAgg().
partitionAggregate(Fields(c4),sum(), Fields("sumc4"))
partitionAggregate(Fields("tuple"),count(),Fields("count"))
partitionAggregate(Fields(c6),sum(),Fields("sumc6"))
persistentAggregate


Will this pattern works?
If it works, how to write the persistentAggregate and let multiple aggregated value to be persisted into a single row?


Many thanks!
George











|
| |