public class Sort extends Object
PCollection
instances.Modifier and Type | Class and Description |
---|---|
static class |
Sort.ColumnOrder
To sort by column 2 ascending then column 1 descending, you would use:
sortPairs(coll, by(2, ASCENDING), by(1, DESCENDING))
Column numbering is 1-based. |
static class |
Sort.Order |
Constructor and Description |
---|
Sort() |
Modifier and Type | Method and Description |
---|---|
static <T> PCollection<T> |
sort(PCollection<T> collection)
Sorts the
PCollection using the natural ordering of its elements. |
static <T> PCollection<T> |
sort(PCollection<T> collection,
Sort.Order order)
Sorts the
PCollection using the natural ordering of its elements in
the order specified. |
static <K,V> PTable<K,V> |
sort(PTable<K,V> table)
Sorts the
PTable using the natural ordering of its keys. |
static <K,V> PTable<K,V> |
sort(PTable<K,V> table,
Sort.Order key)
Sorts the
PTable using the natural ordering of its keys in the
order specified. |
static <U,V> PCollection<Pair<U,V>> |
sortPairs(PCollection<Pair<U,V>> collection,
Sort.ColumnOrder... columnOrders)
Sorts the
PCollection of Pair s using the specified column
ordering. |
static <V1,V2,V3,V4> |
sortQuads(PCollection<Tuple4<V1,V2,V3,V4>> collection,
Sort.ColumnOrder... columnOrders)
Sorts the
PCollection of Tuple4 s using the specified column
ordering. |
static <V1,V2,V3> PCollection<Tuple3<V1,V2,V3>> |
sortTriples(PCollection<Tuple3<V1,V2,V3>> collection,
Sort.ColumnOrder... columnOrders)
Sorts the
PCollection of Tuple3 s using the specified column
ordering. |
static PCollection<TupleN> |
sortTuples(PCollection<TupleN> collection,
Sort.ColumnOrder... columnOrders)
Sorts the
PCollection of TupleN s using the specified column
ordering. |
public static <T> PCollection<T> sort(PCollection<T> collection)
PCollection
using the natural ordering of its elements.PCollection
representing the sorted collection.public static <T> PCollection<T> sort(PCollection<T> collection, Sort.Order order)
PCollection
using the natural ordering of its elements in
the order specified.PCollection
representing the sorted collection.public static <K,V> PTable<K,V> sort(PTable<K,V> table)
PTable
using the natural ordering of its keys.PTable
representing the sorted table.public static <K,V> PTable<K,V> sort(PTable<K,V> table, Sort.Order key)
PTable
using the natural ordering of its keys in the
order specified.PTable
representing the sorted collection.public static <U,V> PCollection<Pair<U,V>> sortPairs(PCollection<Pair<U,V>> collection, Sort.ColumnOrder... columnOrders)
PCollection
of Pair
s using the specified column
ordering.PCollection
representing the sorted collection.public static <V1,V2,V3> PCollection<Tuple3<V1,V2,V3>> sortTriples(PCollection<Tuple3<V1,V2,V3>> collection, Sort.ColumnOrder... columnOrders)
PCollection
of Tuple3
s using the specified column
ordering.PCollection
representing the sorted collection.public static <V1,V2,V3,V4> PCollection<Tuple4<V1,V2,V3,V4>> sortQuads(PCollection<Tuple4<V1,V2,V3,V4>> collection, Sort.ColumnOrder... columnOrders)
PCollection
of Tuple4
s using the specified column
ordering.PCollection
representing the sorted collection.public static PCollection<TupleN> sortTuples(PCollection<TupleN> collection, Sort.ColumnOrder... columnOrders)
PCollection
of TupleN
s using the specified column
ordering.PCollection
representing the sorted collection.Copyright © 2013 The Apache Software Foundation. All Rights Reserved.