Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/9214#discussion_r43664109 --- Diff: core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java --- @@ -121,13 +125,22 @@ public BypassMergeSortShuffleWriter( } @Override - public void write(Iterator<Product2<K, V>> records) throws IOException { + public Seq<Tuple2<File, File>> write(Iterator<Product2<K, V>> records) throws IOException { assert (partitionWriters == null); + final File indexFile = shuffleBlockResolver.getIndexFile(shuffleId, mapId); + final File dataFile = shuffleBlockResolver.getDataFile(shuffleId, mapId); if (!records.hasNext()) { partitionLengths = new long[numPartitions]; - shuffleBlockResolver.writeIndexFile(shuffleId, mapId, partitionLengths); + final File tmpIndexFile = shuffleBlockResolver.writeIndexFile(shuffleId, mapId, partitionLengths); mapStatus = MapStatus$.MODULE$.apply(blockManager.shuffleServerId(), partitionLengths); - return; + // create empty data file so we always commit same set of shuffle output files, even if + // data is non-deterministic + final File tmpDataFile = blockManager.diskBlockManager().createTempShuffleBlock()._2(); + tmpDataFile.createNewFile(); --- End diff -- Check the return value? This method doesn't throw on error.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org