Class KeyedPCollectionTuple<K>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.join.KeyedPCollectionTuple<K>
-
- Type Parameters:
K
- the type of key shared by all constituent PCollections
- All Implemented Interfaces:
PInput
public class KeyedPCollectionTuple<K> extends java.lang.Object implements PInput
An immutable tuple of keyedPCollections
with key type K. (PCollections
containing values of typeKV<K, ?>
)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyedPCollectionTuple.TaggedKeyedPCollection<K,V>
A utility class to help ensure coherence of tag and input PCollection types.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> KeyedPCollectionTuple<K>
and(java.lang.String tag, PCollection<KV<K,V>> pc)
A version ofand(String, PCollection)
that takes in a string instead of a TupleTag.<V> KeyedPCollectionTuple<K>
and(TupleTag<V> tag, PCollection<KV<K,V>> pc)
Returns a newKeyedPCollectionTuple<K>
that is the same as this, appended with the given PCollection.<OutputT extends POutput>
OutputTapply(java.lang.String name, PTransform<KeyedPCollectionTuple<K>,OutputT> transform)
<OutputT extends POutput>
OutputTapply(PTransform<KeyedPCollectionTuple<K>,OutputT> transform)
Likeapply(String, PTransform)
but defaulting to the name provided by thePTransform
.static <K> KeyedPCollectionTuple<K>
empty(Pipeline pipeline)
Returns an emptyKeyedPCollectionTuple<K>
on the given pipeline.java.util.Map<TupleTag<?>,PValue>
expand()
Expands the componentPCollections
, stripping off any tag-specific information.CoGbkResultSchema
getCoGbkResultSchema()
Returns theCoGbkResultSchema
associated with thisKeyedPCollectionTuple
.Coder<K>
getKeyCoder()
java.util.List<KeyedPCollectionTuple.TaggedKeyedPCollection<K,?>>
getKeyedCollections()
Returns a list ofTaggedKeyedPCollections
for thePCollections
contained in thisKeyedPCollectionTuple
.Pipeline
getPipeline()
boolean
isEmpty()
static <K,InputT>
KeyedPCollectionTuple<K>of(java.lang.String tag, PCollection<KV<K,InputT>> pc)
A version ofof(TupleTag, PCollection)
that takes in a string instead of a TupleTag.static <K,InputT>
KeyedPCollectionTuple<K>of(TupleTag<InputT> tag, PCollection<KV<K,InputT>> pc)
Returns a newKeyedPCollectionTuple<K>
with the given tag and initial PCollection.
-
-
-
Method Detail
-
empty
public static <K> KeyedPCollectionTuple<K> empty(Pipeline pipeline)
Returns an emptyKeyedPCollectionTuple<K>
on the given pipeline.
-
of
public static <K,InputT> KeyedPCollectionTuple<K> of(TupleTag<InputT> tag, PCollection<KV<K,InputT>> pc)
Returns a newKeyedPCollectionTuple<K>
with the given tag and initial PCollection.
-
of
public static <K,InputT> KeyedPCollectionTuple<K> of(java.lang.String tag, PCollection<KV<K,InputT>> pc)
A version ofof(TupleTag, PCollection)
that takes in a string instead of a TupleTag.This method is simpler for cases when a typed tuple-tag is not needed to extract a PCollection, for example when using schema transforms.
-
and
public <V> KeyedPCollectionTuple<K> and(TupleTag<V> tag, PCollection<KV<K,V>> pc)
Returns a newKeyedPCollectionTuple<K>
that is the same as this, appended with the given PCollection.
-
and
public <V> KeyedPCollectionTuple<K> and(java.lang.String tag, PCollection<KV<K,V>> pc)
A version ofand(String, PCollection)
that takes in a string instead of a TupleTag.This method is simpler for cases when a typed tuple-tag is not needed to extract a PCollection, for example when using schema transforms.
-
isEmpty
public boolean isEmpty()
-
getKeyedCollections
public java.util.List<KeyedPCollectionTuple.TaggedKeyedPCollection<K,?>> getKeyedCollections()
Returns a list ofTaggedKeyedPCollections
for thePCollections
contained in thisKeyedPCollectionTuple
.
-
apply
public <OutputT extends POutput> OutputT apply(PTransform<KeyedPCollectionTuple<K>,OutputT> transform)
Likeapply(String, PTransform)
but defaulting to the name provided by thePTransform
.
-
apply
public <OutputT extends POutput> OutputT apply(java.lang.String name, PTransform<KeyedPCollectionTuple<K>,OutputT> transform)
Applies the givenPTransform
to this inputKeyedPCollectionTuple
and returns itsOutputT
. This usesname
to identify the specific application of the transform. This name is used in various places, including the monitoring UI, logging, and to stably identify this application node in the job graph.
-
expand
public java.util.Map<TupleTag<?>,PValue> expand()
Expands the componentPCollections
, stripping off any tag-specific information.
-
getCoGbkResultSchema
public CoGbkResultSchema getCoGbkResultSchema()
Returns theCoGbkResultSchema
associated with thisKeyedPCollectionTuple
.
-
getPipeline
public Pipeline getPipeline()
Description copied from interface:PInput
- Specified by:
getPipeline
in interfacePInput
-
-