|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PTable<K,V>
A sub-interface of PCollection
that represents an immutable,
distributed multi-map of keys and values.
Method Summary | ||
---|---|---|
PTable<K,V> |
bottom(int count)
Returns a PTable made up of the pairs in this PTable with the smallest value field. |
|
|
cogroup(PTable<K,U> other)
Co-group operation with the given table on common keys. |
|
PTable<K,Collection<V>> |
collectValues()
Aggregate all of the values with the same key into a single key-value pair in the returned PTable. |
|
PType<K> |
getKeyType()
Returns the PType of the key. |
|
PTableType<K,V> |
getPTableType()
Returns the PTableType of this PTable . |
|
PType<V> |
getValueType()
Returns the PType of the value. |
|
PGroupedTable<K,V> |
groupByKey()
Performs a grouping operation on the keys of this table. |
|
PGroupedTable<K,V> |
groupByKey(GroupingOptions options)
Performs a grouping operation on the keys of this table, using the additional GroupingOptions to control how the grouping is executed. |
|
PGroupedTable<K,V> |
groupByKey(int numPartitions)
Performs a grouping operation on the keys of this table, using the given number of partitions. |
|
|
join(PTable<K,U> other)
Perform an inner join on this table and the one passed in as an argument on their common keys. |
|
PCollection<K> |
keys()
Returns a PCollection made up of the keys in this PTable. |
|
Map<K,V> |
materializeToMap()
Returns a Map |
|
PTable<K,V> |
top(int count)
Returns a PTable made up of the pairs in this PTable with the largest value field. |
|
PTable<K,V> |
union(PTable<K,V>... others)
Returns a PTable instance that acts as the union of this
PTable and the input PTable s. |
|
PCollection<V> |
values()
Returns a PCollection made up of the values in this PTable. |
|
PTable<K,V> |
write(Target target)
Writes this PTable to the given Target . |
Methods inherited from interface org.apache.crunch.PCollection |
---|
by, by, count, filter, filter, getName, getPipeline, getPType, getSize, getTypeFamily, materialize, max, min, parallelDo, parallelDo, parallelDo, parallelDo, sample, sample, sort, union |
Method Detail |
---|
PTable<K,V> union(PTable<K,V>... others)
PTable
instance that acts as the union of this
PTable
and the input PTable
s.
PGroupedTable<K,V> groupByKey()
PGroupedTable
instance that represents the groupingPGroupedTable<K,V> groupByKey(int numPartitions)
numPartitions
- The number of partitions for the data.
PGroupedTable
instance that represents this groupingPGroupedTable<K,V> groupByKey(GroupingOptions options)
GroupingOptions
to control how the grouping is executed.
options
- The grouping options to use
PGroupedTable
instance that represents the groupingPTable<K,V> write(Target target)
PTable
to the given Target
.
write
in interface PCollection<Pair<K,V>>
target
- The target to write toPTableType<K,V> getPTableType()
PTableType
of this PTable
.
PType<K> getKeyType()
PType
of the key.
PType<V> getValueType()
PType
of the value.
PTable<K,Collection<V>> collectValues()
PTable<K,V> top(int count)
count
- The number of pairs to returnPTable<K,V> bottom(int count)
count
- The number of pairs to return<U> PTable<K,Pair<V,U>> join(PTable<K,U> other)
<U> PTable<K,Pair<Collection<V>,Collection<U>>> cogroup(PTable<K,U> other)
PCollection<K> keys()
PCollection
made up of the keys in this PTable.
PCollection<V> values()
PCollection
made up of the values in this PTable.
Map<K,V> materializeToMap()
Note: The contents of the returned map may not be exactly the same as this PTable, as a PTable is a multi-map (i.e. can contain multiple values for a single key).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |