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