public class View
extends java.lang.Object
PCollectionViews from PCollections,
for consuming the contents of those PCollections as side inputs
to ParDo transforms.| Modifier and Type | Class and Description |
|---|---|
static class |
View.AsIterable<T>
A
PTransform that produces a PCollectionView of a singleton
PCollection yielding the single element it contains. |
static class |
View.AsMultimap<K,V>
A
PTransform that produces a PCollectionView of a keyed PCollection
yielding a map of keys to all associated values. |
static class |
View.AsSingleton<T>
A
PTransform that produces a PCollectionView of a singleton
PCollection yielding the single element it contains. |
static class |
View.AsSingletonMap<K,VI,VO>
A
PTransform that produces a PCollectionView of a keyed PCollection
yielding a map of keys to a single associated values. |
static class |
View.CreatePCollectionView<R,T>
Creates a primitive PCollectionView.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> View.AsIterable<T> |
asIterable()
Returns a
View.AsIterable that takes a
PCollection as input and produces a PCollectionView
of the values, to be consumed as an iterable side input. |
static <K,V> View.AsMultimap<K,V> |
asMap()
Returns an
View.AsMultimap that takes a PCollection as input
and produces a PCollectionView of the values to be consumed
as a Map<K, Iterable<V>> side input. |
static <T> View.AsSingleton<T> |
asSingleton()
Returns a
View.AsSingleton transform that takes a singleton
PCollection as input and produces a PCollectionView
of the single value, to be consumed as a side input. |
public static <T> View.AsSingleton<T> asSingleton()
View.AsSingleton transform that takes a singleton
PCollection as input and produces a PCollectionView
of the single value, to be consumed as a side input.
If the input PCollection is empty,
throws NoSuchElementException in the consuming
DoFn.
If the input PCollection contains more than one
element, throws IllegalArgumentException in the
consuming DoFn.
public static <T> View.AsIterable<T> asIterable()
View.AsIterable that takes a
PCollection as input and produces a PCollectionView
of the values, to be consumed as an iterable side input.public static <K,V> View.AsMultimap<K,V> asMap()
View.AsMultimap that takes a PCollection as input
and produces a PCollectionView of the values to be consumed
as a Map<K, Iterable<V>> side input.
Currently, the resulting map is required to fit into memory.