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) {
SparkComparator scmp = new SparkComparator(groupingOptions, ptype, runtime.getRuntimeContext());