attilapiros commented on a change in pull request #28618: URL: https://github.com/apache/spark/pull/28618#discussion_r440799753
########## File path: core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java ########## @@ -273,19 +280,24 @@ void forceSorterToSpill() throws IOException { if (maybeSingleFileWriter.isPresent()) { // Here, we don't need to perform any metrics updates because the bytes written to this // output file would have already been counted as shuffle bytes written. - partitionLengths = spills[0].partitionLengths; - maybeSingleFileWriter.get().transferMapSpillFile(spills[0].file, partitionLengths); + Optional<MapOutputMetadata> maybeMetadata = + maybeSingleFileWriter.get().transferMapSpillFile( + spills[0].file, spills[0].partitionLengths); + mapOutputCommitMessage = maybeMetadata.map( + metadata -> MapOutputCommitMessage.of(spills[0].partitionLengths, metadata)) + .orElse(MapOutputCommitMessage.of(spills[0].partitionLengths)); Review comment: I cannot se why `transferMapSpillFile` cannot return a `MapOutputCommitMessage` that would simply this part: https://github.com/attilapiros/spark/commit/289050e4309b024146867b7b32974ab4746eb570 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org