Class CoGbkResult
java.lang.Object
org.apache.beam.sdk.transforms.join.CoGbkResult
A row result of a
CoGroupByKey. This is a tuple of Iterables 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 thePCollectionresulting from aCoGroupByKeytransform.CoGbkResult(CoGbkResultSchema schema, Iterable<RawUnionValue> taggedValues, int inMemoryElementCount, int minElementsPerTag) -
Method Summary
Modifier and TypeMethodDescription<V> CoGbkResultReturns a newCoGbkResultbased on this, with the given tag and given data added to it.static CoGbkResultempty()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> VLikegetOnly(TupleTag)but using a String instead of a TupleTag.<V> @Nullable VLikegetOnly(TupleTag, Object)but using a String instead of a TupleTag.<V> VIf there is a singleton value for the given tag, returns it.<V> @Nullable VIf there is a singleton value for the given tag, returns it.Returns the schema used by thisCoGbkResult.booleanisEmpty()static <V> CoGbkResultReturns a new CoGbkResult that contains just the given tag and given data.toString()
-
Constructor Details
-
CoGbkResult
A row in thePCollectionresulting from aCoGroupByKeytransform. 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 newCoGbkResultbased on this, with the given tag and given data added to it. -
empty
Returns an emptyCoGbkResult.
-