public class Sort extends Object
PCollection instances.| Modifier and Type | Class and Description | 
|---|---|
| static class  | Sort.ColumnOrderTo 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.OrderFor signaling the order in which a sort should be done. | 
| Constructor and Description | 
|---|
| Sort() | 
| Modifier and Type | Method and Description | 
|---|---|
| static <T> PCollection<T> | sort(PCollection<T> collection)Sorts the  PCollectionusing the natural ordering of its elements in ascending order. | 
| static <T> PCollection<T> | sort(PCollection<T> collection,
    int numReducers,
    Sort.Order order)Sorts the  PCollectionusing the natural ordering of its elements in
 the order specified using the given number of reducers. | 
| static <T> PCollection<T> | sort(PCollection<T> collection,
    Sort.Order order)Sorts the  PCollectionusing the natural order of its elements with the givenOrder. | 
| static <K,V> PTable<K,V> | sort(PTable<K,V> table)Sorts the  PTableusing the natural ordering of its keys in ascending order. | 
| static <K,V> PTable<K,V> | sort(PTable<K,V> table,
    int numReducers,
    Sort.Order key)Sorts the  PTableusing the natural ordering of its keys in the
 order specified with a client-specified number of reducers. | 
| static <K,V> PTable<K,V> | sort(PTable<K,V> table,
    Sort.Order key)Sorts the  PTableusing the natural ordering of its keys with the givenOrder. | 
| static <U,V> PCollection<Pair<U,V>> | sortPairs(PCollection<Pair<U,V>> collection,
         Sort.ColumnOrder... columnOrders)Sorts the  PCollectionofPairs using the specified column
 ordering. | 
| static <V1,V2,V3,V4> | sortQuads(PCollection<Tuple4<V1,V2,V3,V4>> collection,
         Sort.ColumnOrder... columnOrders)Sorts the  PCollectionofTuple4s 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  PCollectionofTuple3s using the specified column
 ordering. | 
| static <T extends Tuple> | sortTuples(PCollection<T> collection,
          int numReducers,
          Sort.ColumnOrder... columnOrders)Sorts the  PCollectionofTupleNs using the specified column
 ordering and a client-specified number of reducers. | 
| static <T extends Tuple> | sortTuples(PCollection<T> collection,
          Sort.ColumnOrder... columnOrders)Sorts the  PCollectionof tuples using the specified column ordering. | 
public static <T> PCollection<T> sort(PCollection<T> collection)
PCollection using the natural ordering of its elements in ascending order.PCollection representing the sorted collection.public static <T> PCollection<T> sort(PCollection<T> collection, Sort.Order order)
PCollection using the natural order of its elements with the given Order.PCollection representing the sorted collection.public static <T> PCollection<T> sort(PCollection<T> collection, int numReducers, Sort.Order order)
PCollection using the natural ordering of its elements in
 the order specified using the given number of reducers.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 in ascending order.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 with the given Order.PTable representing the sorted table.public static <K,V> PTable<K,V> sort(PTable<K,V> table, int numReducers, Sort.Order key)
PTable using the natural ordering of its keys in the
 order specified with a client-specified number of reducers.PTable representing the sorted collection.public static <U,V> PCollection<Pair<U,V>> sortPairs(PCollection<Pair<U,V>> collection, Sort.ColumnOrder... columnOrders)
PCollection of Pairs 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 Tuple3s 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 Tuple4s using the specified column
 ordering.PCollection representing the sorted collection.public static <T extends Tuple> PCollection<T> sortTuples(PCollection<T> collection, Sort.ColumnOrder... columnOrders)
PCollection of tuples using the specified column ordering.PCollection representing the sorted collection.public static <T extends Tuple> PCollection<T> sortTuples(PCollection<T> collection, int numReducers, Sort.ColumnOrder... columnOrders)
PCollection of TupleNs using the specified column
 ordering and a client-specified number of reducers.PCollection representing the sorted collection.Copyright © 2017 The Apache Software Foundation. All rights reserved.