/** * An analogue of the {@code mapValues} function for {@code PGroupedTable<K, U>} collections. * * @param name The name of the operation * @param ptable The {@code PGroupedTable} to be mapped * @param mapFn The mapping function * @param ptype The PType for the returned values * @return A new {@code PTable<K, V>} instance */ public static <K, U, V> PTable<K, V> mapValues(String name, PGroupedTable<K, U> ptable, MapFn<Iterable<U>, V> mapFn, PType<V> ptype) { PTypeFamily ptf = ptable.getTypeFamily(); return ptable.parallelDo(name, new PairMapFn<K, Iterable<U>, K, V>(IdentityFn.<K>getInstance(), mapFn), ptf.tableOf((PType<K>) ptable.getPType().getSubTypes().get(0), ptype)); }