V
- the type of the values in the input PCollection
,
and the type of the elements in the output PCollection
public class Values<V> extends PTransform<PCollection<? extends KV<?,V>>,PCollection<V>>
Values<V>
takes a PCollection
of KV<K, V>
s and
returns a PCollection<V>
of the values.
Example of use:
PCollection<KV<String, Long>> wordCounts = ...;
PCollection<Long> counts = wordCounts.apply(Values.<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 Keys
.
name
Modifier and Type | Method and Description |
---|---|
static <V> Values<V> |
create()
Returns a
Values<V> PTransform . |
PCollection<V> |
expand(PCollection<? extends KV<?,V>> in)
Applies this
PTransform on the given InputT , and returns its
Output . |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public static <V> Values<V> create()
Values<V>
PTransform
.V
- the type of the values in the input PCollection
,
and the type of the elements in the output PCollection
public PCollection<V> expand(PCollection<? extends KV<?,V>> in)
PTransform
PTransform
on the given InputT
, 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).
expand
in class PTransform<PCollection<? extends KV<?,V>>,PCollection<V>>