Github user wangjiaochun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23225#discussion_r239704796
  
    --- Diff: 
core/src/test/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriterSuite.java 
---
    @@ -562,4 +562,18 @@ public void testPeakMemoryUsed() throws Exception {
         }
       }
     
    +  @Test
    +  public void writeEmptyIteratorNotCreateEmptySpillFile() throws Exception 
{
    +    final UnsafeShuffleWriter<Object, Object> writer = createWriter(true);
    +    writer.write(Iterators.emptyIterator());
    +    final Option<MapStatus> mapStatus = writer.stop(true);
    +    assertTrue(mapStatus.isDefined());
    +    assertTrue(mergedOutputFile.exists());
    +    assertEquals(0, spillFilesCreated.size());
    --- End diff --
    
    I mean that before add code "if (sortedRecords.hasNext()) { return }" it 
will fail. now add assertEquals(0, spillFilesCreated.size()) to 
writeEmptyIterator seems good. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to