Keys (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

com.google.cloud.dataflow.sdk.transforms

Class Keys<K>

  • Type Parameters:
    K - the type of the keys in the input PCollection, and the type of the elements in the output PCollection
    All Implemented Interfaces:
    HasDisplayData, Serializable


    public class Keys<K>
    extends PTransform<PCollection<? extends KV<K,?>>,PCollection<K>>
    Keys<K> takes a PCollection of KV<K, V>s and returns a PCollection<K> of the keys.

    Example of use:

     
     PCollection<KV<String, Long>> wordCounts = ...;
     PCollection<String> words = wordCounts.apply(Keys.<String>create());
      

    Each output element has the same timestamp and is in the same windows as its corresponding input element, and the output PCollection has the same WindowFn associated with it as the input.

    See also Values.

    See Also:
    Serialized Form
    • Method Detail

      • create

        public static <K> Keys<K> create()
        Returns a Keys<K> PTransform.
        Type Parameters:
        K - the type of the keys in the input PCollection, and the type of the elements in the output PCollection


Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Dataflow