PTable<K, Pair<U, V>> cgRight = right.parallelDo("coGroupTag2", new CogroupFn2<K, U, V>(),
ptf.tableOf(keyType, itype));
PTable<K, Pair<U, V>> both = cgLeft.union(cgRight);
PType<Pair<Collection<U>, Collection<V>>> otype = ptf.pairs(ptf.collections(leftType), ptf.collections(rightType));
return both.groupByKey().parallelDo("cogroup",
new PostGroupFn<K, U, V>(leftType, rightType), ptf.tableOf(keyType, otype));
}
private static class CogroupFn1<K, V, U> extends MapValuesFn<K, V, Pair<V, U>> {