public static class View.AsMultimap<K,V> extends PTransform<PCollection<KV<K,V>>,PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>>
PTransform that produces a PCollectionView of a keyed PCollection
yielding a map of keys to all associated values.
Instantiate via View.asMap().
name| Modifier and Type | Method and Description |
|---|---|
PCollectionView<java.util.Map<K,java.lang.Iterable<V>>> |
apply(PCollection<KV<K,V>> input)
Applies this
PTransform on the given Input, and returns its
Output. |
<VO> View.AsSingletonMap<K,V,VO> |
withCombiner(Combine.CombineFn<V,?,VO> combineFn)
Returns a PTransform creating a view as a
Map<K, VO> rather than a
Map<K, Iterable<V>> by applying the given combiner to the set of
values associated with each key. |
View.AsSingletonMap<K,V,V> |
withSingletonValues()
Returns a PTransform creating a view as a
Map<K, V> rather than a
Map<K, Iterable<V>>. |
finishSpecifyingInternal, getDefaultName, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, setName, setPipeline, toString, validate, withNamepublic View.AsSingletonMap<K,V,V> withSingletonValues()
Map<K, V> rather than a
Map<K, Iterable<V>>. Requires that the PCollection have only
one value per key.public <VO> View.AsSingletonMap<K,V,VO> withCombiner(Combine.CombineFn<V,?,VO> combineFn)
Map<K, VO> rather than a
Map<K, Iterable<V>> by applying the given combiner to the set of
values associated with each key.public PCollectionView<java.util.Map<K,java.lang.Iterable<V>>> apply(PCollection<KV<K,V>> input)
PTransformPTransform on the given Input, and returns its
Output.
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).
The default implementation throws an exception. A derived class must
either implement apply, or else each runner must supply a custom
implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<Input, Output>, Input).
apply in class PTransform<PCollection<KV<K,V>>,PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>>