This may work.

myStream.groupBy(new Fields("user"))
        .persistentAggregate(new MemoryMapState.Factory(),
                             new Fields("some_int_1"),
                             new Sum(),
                             new Fields("total_some_int_1")
        .newValuesStream()
        .persistentAggregate(new MemoryMapState.Factory(),
                             new Fields("some_int_2"),
                             new Sum(),
                             new Fields("total_some_int_2");

You could also create your own Function to combine 1 and 2 into a single
object and implement your own CombinerAggregator for it. This is how you
could do it with only one aggregate step and it also lets your store the
values together.

Reply via email to