KvSwap (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 KvSwap<K,V>

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


    public class KvSwap<K,V>
    extends PTransform<PCollection<KV<K,V>>,PCollection<KV<V,K>>>
    KvSwap<K, V> takes a PCollection<KV<K, V>> and returns a PCollection<KV<V, K>>, where all the keys and values have been swapped.

    Example of use:

     
     PCollection<String, Long> wordsToCounts = ...;
     PCollection<Long, String> countsToWords =
         wordToCounts.apply(KvSwap.<String, Long>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:
    Serialized Form
    • Method Detail

      • create

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


이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.