}
JavaPairRDD<ByteArray, List<byte[]>> groupedRDD;
if (groupingOptions.getPartitionerClass() != null) {
groupedRDD = parentRDD
.map(new PairMapFunction(ptype.getOutputMapFn(), runtime.getRuntimeContext()))
.mapToPair(
new PartitionedMapOutputFunction(keySerde, valueSerde, ptype, groupingOptions.getPartitionerClass(),
numPartitions, runtime.getRuntimeContext()))
.groupByKey(new SparkPartitioner(numPartitions));
} else {
groupedRDD = parentRDD
.map(new PairMapFunction(ptype.getOutputMapFn(), runtime.getRuntimeContext()))
.mapToPair(new MapOutputFunction(keySerde, valueSerde))
.groupByKey(numPartitions);
}
if (groupingOptions.requireSortedKeys() || groupingOptions.getSortComparatorClass() != null) {