Sums all the elements within each aggregation.
In the following example, we create a pipeline with a
Then, we get the sum of all the element values in different ways.
Example 1: Sum of the elements in a PCollection
Combine.Globally() to get sum of all the element values from the entire
Example 2: Sum of the elements for each key
Combine.PerKey() to get the sum of all the element values for each unique key in a
PCollection of key-values.
Last updated on 2021/02/05
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!