storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Mocanu <>
Subject aggregation in Trident
Date Fri, 07 Feb 2014 17:36:36 GMT
Hi group

Q1: What is the difference between Sum() and Count() as aggregators? I thought they meant
the same thing ie: you count to get the sum. gives this
example where both are emitted:
        .partitionAggregate(new Count(), new Fields("count"))
        .partitionAggregate(new Fields("b"), new Sum(), new Fields("sum"))

If  you have a tuple with 3 fields like ("name","value","field3") and want to count how many
tuples with the same name you get I can easily use a Count() or Sum() (are they interchangeable?-
see Q1). Problem is after aggregation I get only the sum and not the other fields like "name"
and "field3"
Maybe Trident API wiki page can be updated with such an example


View raw message