Sum
Transforms for computing the sum of the elements in a collection, or the sum of the values associated with each key in a collection of key-value pairs.
Examples
Example 1: get the sum of a PCollection
of Doubles
.
Example 2: calculate the sum of the Integers
associated with each unique key (which is of type String
).
Related transforms
- Count counts the number of elements within each aggregation
Last updated on 2024/12/04
Have you found everything you were looking for?
Was it all useful and clear? Is there anything that you would like to change? Let us know!