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