question: sorts the map 's records in place , spill them to disk , and returns an unsafekvexternalsorter note that the map will be reset for inserting new records , and the returned sorter can not be used to insert records . concode_field_sep UnsafeProjection groupingKeyProjection concode_elem_sep StructType groupingKeySchema concode_elem_sep byte[] emptyAggregationBuffer concode_elem_sep boolean enablePerfMetrics concode_elem_sep StructType aggregationBufferSchema concode_elem_sep UnsafeRow currentAggregationBuffer concode_elem_sep BytesToBytesMap map concode_field_sep void printPerfMetrics concode_elem_sep KVIterator<UnsafeRow,UnsafeRow> iterator concode_elem_sep boolean supportsAggregationBufferSchema concode_elem_sep UnsafeRow getAggregationBuffer concode_elem_sep UnsafeRow getAggregationBufferFromUnsafeRow concode_elem_sep UnsafeRow getAggregationBufferFromUnsafeRow concode_elem_sep long getPeakMemoryUsedBytes concode_elem_sep void free
target: UnsafeKVExternalSorter function ( ) { return new UnsafeKVExternalSorter ( groupingKeySchema , aggregationBufferSchema , SparkEnv . get ( ) . blockManager ( ) , map . getPageSizeBytes ( ) , map ) ; }