public class CoGbkResult
extends java.lang.Object
CoGroupByKey
. This is a tuple of Iterable
s produced for a given
key, and these can be accessed in different ways.Modifier and Type | Class and Description |
---|---|
static class |
CoGbkResult.CoGbkResultCoder
A
Coder for CoGbkResult s. |
Constructor and Description |
---|
CoGbkResult(CoGbkResultSchema schema,
java.lang.Iterable<RawUnionValue> taggedValues)
A row in the
PCollection resulting from a CoGroupByKey transform. |
CoGbkResult(CoGbkResultSchema schema,
java.lang.Iterable<RawUnionValue> taggedValues,
int inMemoryElementCount) |
Modifier and Type | Method and Description |
---|---|
<V> CoGbkResult |
and(TupleTag<V> tag,
java.util.List<V> data)
Returns a new
CoGbkResult based on this, with the given tag and given data added to it. |
static <V> CoGbkResult |
empty()
Returns an empty
CoGbkResult . |
<V> java.lang.Iterable<V> |
getAll(java.lang.String tag)
Like
getAll(TupleTag) but using a String instead of a TupleTag . |
<V> java.lang.Iterable<V> |
getAll(TupleTag<V> tag)
Returns the values from the table represented by the given
TupleTag<V> as an Iterable<V> (which may be empty if there are no results). |
<V> V |
getOnly(java.lang.String tag)
Like
getOnly(TupleTag) but using a String instead of a TupleTag. |
<V> V |
getOnly(java.lang.String tag,
V defaultValue)
Like
getOnly(TupleTag, Object) but using a String instead of a TupleTag. |
<V> V |
getOnly(TupleTag<V> tag)
If there is a singleton value for the given tag, returns it.
|
<V> V |
getOnly(TupleTag<V> tag,
V defaultValue)
If there is a singleton value for the given tag, returns it.
|
CoGbkResultSchema |
getSchema()
Returns the schema used by this
CoGbkResult . |
boolean |
isEmpty() |
static <V> CoGbkResult |
of(TupleTag<V> tag,
java.util.List<V> data)
Returns a new CoGbkResult that contains just the given tag and given data.
|
java.lang.String |
toString() |
public CoGbkResult(CoGbkResultSchema schema, java.lang.Iterable<RawUnionValue> taggedValues)
PCollection
resulting from a CoGroupByKey
transform. Currently,
this row must fit into memory.schema
- the set of tuple tags used to refer to input tables and result valuestaggedValues
- the raw results from a group-by-keypublic CoGbkResult(CoGbkResultSchema schema, java.lang.Iterable<RawUnionValue> taggedValues, int inMemoryElementCount)
public boolean isEmpty()
public CoGbkResultSchema getSchema()
CoGbkResult
.public java.lang.String toString()
toString
in class java.lang.Object
public <V> java.lang.Iterable<V> getAll(TupleTag<V> tag)
TupleTag<V>
as an Iterable<V>
(which may be empty if there are no results).
If tag was not part of the original CoGroupByKey
, throws an
IllegalArgumentException.
public <V> java.lang.Iterable<V> getAll(java.lang.String tag)
getAll(TupleTag)
but using a String instead of a TupleTag
.public <V> V getOnly(TupleTag<V> tag)
If tag was not part of the original CoGroupByKey
, throws an
IllegalArgumentException.
public <V> V getOnly(java.lang.String tag)
getOnly(TupleTag)
but using a String instead of a TupleTag.public <V> V getOnly(TupleTag<V> tag, V defaultValue)
If tag was not part of the original CoGroupByKey
, throws an
IllegalArgumentException.
public <V> V getOnly(java.lang.String tag, V defaultValue)
getOnly(TupleTag, Object)
but using a String instead of a TupleTag.public static <V> CoGbkResult of(TupleTag<V> tag, java.util.List<V> data)
public <V> CoGbkResult and(TupleTag<V> tag, java.util.List<V> data)
CoGbkResult
based on this, with the given tag and given data added to it.public static <V> CoGbkResult empty()
CoGbkResult
.