Class Distinct.WithRepresentativeValues<T,IdT>

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<T>,PCollection<T>>
org.apache.beam.sdk.transforms.Distinct.WithRepresentativeValues<T,IdT>
Type Parameters:
T - the type of input and output element
IdT - the type of representative values used to dedup
All Implemented Interfaces:
Serializable, HasDisplayData
Enclosing class:
Distinct<T>

public static class Distinct.WithRepresentativeValues<T,IdT> extends PTransform<PCollection<T>,PCollection<T>>
A Distinct PTransform that uses a SerializableFunction to obtain a representative value for each input element.

Construct via Distinct.withRepresentativeValueFn(SerializableFunction).

See Also:
  • Method Details

    • expand

      public PCollection<T> expand(PCollection<T> in)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PCollection<T>,PCollection<T>>
    • withRepresentativeType

      public Distinct.WithRepresentativeValues<T,IdT> withRepresentativeType(TypeDescriptor<IdT> type)
      Return a WithRepresentativeValues PTransform that is like this one, but with the specified output type descriptor.

      Required for use of Distinct.withRepresentativeValueFn(SerializableFunction) in Java 8 with a lambda as the fn.

      Parameters:
      type - a TypeDescriptor describing the representative type of this WithRepresentativeValues
      Returns:
      A WithRepresentativeValues PTransform that is like this one, but with the specified output type descriptor.