Class Max

java.lang.Object
org.apache.beam.sdk.transforms.Max

public class Max extends Object
PTransforms for computing the maximum of the elements in a PCollection, or the maximum of the values associated with each key in a PCollection of KVs.

Example 1: get the maximum of a PCollection of Doubles.


 PCollection<Double> input = ...;
 PCollection<Double> max = input.apply(Max.doublesGlobally());
 

Example 2: calculate the maximum of the Integers associated with each unique key (which is of type String).


 PCollection<KV<String, Integer>> input = ...;
 PCollection<KV<String, Integer>> maxPerKey = input
     .apply(Max.<String>integersPerKey());