Package org.apache.beam.sdk.transforms
Class Values<V>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<PCollection<? extends KV<?,V>>,PCollection<V>>
-
- org.apache.beam.sdk.transforms.Values<V>
-
- Type Parameters:
V
- the type of the values in the inputPCollection
, and the type of the elements in the outputPCollection
- All Implemented Interfaces:
java.io.Serializable
,HasDisplayData
public class Values<V> extends PTransform<PCollection<? extends KV<?,V>>,PCollection<V>>
Values<V>
takes aPCollection
ofKV<K, V>
s and returns aPCollection<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 sameWindowFn
associated with it as the input.See also
Keys
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
name, resourceHints
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> Values<V>
create()
Returns aValues<V>
PTransform
.PCollection<V>
expand(PCollection<? extends KV<?,V>> in)
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
create
public static <V> Values<V> create()
Returns aValues<V>
PTransform
.- Type Parameters:
V
- the type of the values in the inputPCollection
, and the type of the elements in the outputPCollection
-
expand
public PCollection<V> expand(PCollection<? extends KV<?,V>> in)
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.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).
- Specified by:
expand
in classPTransform<PCollection<? extends KV<?,V>>,PCollection<V>>
-
-