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

    https://github.com/apache/spark/pull/19464#discussion_r144235787
  
    --- Diff: core/src/test/scala/org/apache/spark/FileSuite.scala ---
    @@ -510,4 +510,16 @@ class FileSuite extends SparkFunSuite with 
LocalSparkContext {
         }
       }
     
    +  test("spark.hadoop.filterOutEmptySplit") {
    +    val sf = new SparkConf()
    +    
sf.setAppName("test").setMaster("local").set("spark.hadoop.filterOutEmptySplit",
 "true")
    +    sc = new SparkContext(sf)
    +    val emptyRDD = sc.parallelize(Array.empty[Tuple2[String, String]], 1)
    +    emptyRDD.saveAsHadoopFile[TextOutputFormat[String, 
String]](tempDir.getPath + "/output")
    +    assert(new File(tempDir.getPath + "/output/part-00000").exists() === 
true)
    +
    +    val hadoopRDD = sc.textFile(tempDir.getPath + "/output/part-00000")
    +    assert(hadoopRDD.partitions.length === 0)
    --- End diff --
    
    The resources will be recycled by default in the afterEach function.


---

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

Reply via email to