| |
|
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
|
| |