/** * Sorts the {@code PTable} using the natural ordering of its keys in the * order specified with a client-specified number of reducers. * * @return a {@code PTable} representing the sorted collection. */ public static <K, V> PTable<K, V> sort(PTable<K, V> table, int numReducers, Order key) { Configuration conf = table.getPipeline().getConfiguration(); GroupingOptions options = buildGroupingOptions(table, conf, numReducers, key); return table.groupByKey(options).ungroup(); }
/** * Sorts the {@link PTable} using the natural ordering of its keys * in the order specified. * * @return a {@link PTable} representing the sorted collection. */ public static <K, V> PTable<K, V> sort(PTable<K, V> table, Order key) { PTypeFamily tf = table.getTypeFamily(); Configuration conf = table.getPipeline().getConfiguration(); GroupingOptions options = buildGroupingOptions(conf, tf, table.getKeyType(), key); return table.groupByKey(options).ungroup(); }
/** * Sorts the {@link PTable} using the natural ordering of its keys in the * order specified. * * @return a {@link PTable} representing the sorted collection. */ public static <K, V> PTable<K, V> sort(PTable<K, V> table, Order key) { PTypeFamily tf = table.getTypeFamily(); Configuration conf = table.getPipeline().getConfiguration(); GroupingOptions options = buildGroupingOptions(conf, tf, table.getKeyType(), key); return table.groupByKey(options).ungroup(); }
if (!(right.getPipeline() instanceof MRPipeline)) { throw new CrunchRuntimeException("Map-side join is only supported within a MapReduce context"); MRPipeline pipeline = (MRPipeline) right.getPipeline(); pipeline.materialize(right);