PType<Pair<V1, V2>> valueType = input.getValueType();
PTableType<Pair<K, V1>, Pair<V1, V2>> inter = ptf.tableOf(
ptf.pairs(input.getKeyType(), valueType.getSubTypes().get(0)),
valueType);
PTableType<K, Collection<Pair<V1, V2>>> out = ptf.tableOf(input.getKeyType(),
ptf.collections(input.getValueType()));
return input.parallelDo("SecondarySort.format", new SSFormatFn<K, V1, V2>(), inter)
.groupByKey(
GroupingOptions.builder()
.groupingComparatorClass(JoinUtils.getGroupingComparator(ptf))
.partitionerClass(JoinUtils.getPartitionerClass(ptf))