Class Min


  • public class Min
    extends java.lang.Object
    PTransforms for computing the minimum of the elements in a PCollection, or the minimum of the values associated with each key in a PCollection of KVs.

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

    
     PCollection<Double> input = ...;
     PCollection<Double> min = input.apply(Min.doublesGlobally());
     

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

    
     PCollection<KV<String, Integer>> input = ...;
     PCollection<KV<String, Integer>> minPerKey = input
         .apply(Min.<String>integersPerKey());