SparkComparator scmp = new SparkComparator(groupingOptions, ptype, runtime.getRuntimeContext());
groupedRDD = groupedRDD.sortByKey(scmp);
}
if (groupingOptions.getGroupingComparatorClass() != null) {
groupedRDD = groupedRDD.mapPartitionsToPair(
new ReduceGroupingFunction(groupingOptions, ptype, runtime.getRuntimeContext()));
}
return groupedRDD
.map(new ReduceInputFunction(keySerde, valueSerde))
.mapToPair(new PairMapIterableFunction(ptype.getInputMapFn(), runtime.getRuntimeContext()));