Class CoGbkResult
java.lang.Object
org.apache.beam.sdk.transforms.join.CoGbkResult
A row result of a
CoGroupByKey
. This is a tuple of Iterable
s produced for a given
key, and these can be accessed in different ways.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCoGbkResult
(CoGbkResultSchema schema, Iterable<RawUnionValue> taggedValues) A row in thePCollection
resulting from aCoGroupByKey
transform.CoGbkResult
(CoGbkResultSchema schema, Iterable<RawUnionValue> taggedValues, int inMemoryElementCount, int minElementsPerTag) -
Method Summary
Modifier and TypeMethodDescription<V> CoGbkResult
Returns a newCoGbkResult
based on this, with the given tag and given data added to it.static <V> CoGbkResult
empty()
Returns an emptyCoGbkResult
.<V> Iterable
<V> LikegetAll(TupleTag)
but using a String instead of aTupleTag
.<V> Iterable
<V> Returns the values from the table represented by the givenTupleTag<V>
as anIterable<V>
(which may be empty if there are no results).<V> V
LikegetOnly(TupleTag)
but using a String instead of a TupleTag.<V> @Nullable V
LikegetOnly(TupleTag, Object)
but using a String instead of a TupleTag.<V> V
If there is a singleton value for the given tag, returns it.<V> @Nullable V
If there is a singleton value for the given tag, returns it.Returns the schema used by thisCoGbkResult
.boolean
isEmpty()
static <V> CoGbkResult
Returns a new CoGbkResult that contains just the given tag and given data.toString()
-
Constructor Details
-
CoGbkResult
A row in thePCollection
resulting from aCoGroupByKey
transform. Currently, this row must fit into memory.- Parameters:
schema
- the set of tuple tags used to refer to input tables and result valuestaggedValues
- the raw results from a group-by-key
-
CoGbkResult
public CoGbkResult(CoGbkResultSchema schema, Iterable<RawUnionValue> taggedValues, int inMemoryElementCount, int minElementsPerTag)
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
getSchema
Returns the schema used by thisCoGbkResult
. -
toString
-
getAll
Returns the values from the table represented by the givenTupleTag<V>
as anIterable<V>
(which may be empty if there are no results).If tag was not part of the original
CoGroupByKey
, throws an IllegalArgumentException. -
getAll
LikegetAll(TupleTag)
but using a String instead of aTupleTag
. -
getOnly
If there is a singleton value for the given tag, returns it. Otherwise, throws an IllegalArgumentException.If tag was not part of the original
CoGroupByKey
, throws an IllegalArgumentException. -
getOnly
LikegetOnly(TupleTag)
but using a String instead of a TupleTag. -
getOnly
If there is a singleton value for the given tag, returns it. If there is no value for the given tag, returns the defaultValue.If tag was not part of the original
CoGroupByKey
, throws an IllegalArgumentException. -
getOnly
LikegetOnly(TupleTag, Object)
but using a String instead of a TupleTag. -
of
Returns a new CoGbkResult that contains just the given tag and given data. -
and
Returns a newCoGbkResult
based on this, with the given tag and given data added to it. -
empty
Returns an emptyCoGbkResult
.
-