@@ -561,7 +561,10 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
561561 val output = new File (tempDir, " output" + outputSuffix)
562562 dataRDD.saveAsNewAPIHadoopFile[NewTextOutputFormat [String , String ]](output.getPath)
563563 assert(new File (output, checkPart).exists() === true )
564- val hadoopRDD = sc.textFile(new File (output, " part-r-*" ).getPath)
564+
565+ val hadoopRDD = sc.newAPIHadoopFile(new File (output, " part-r-*" ).getPath,
566+ classOf [NewTextInputFormat ], classOf [LongWritable ], classOf [Text ])
567+ .asInstanceOf [NewHadoopRDD [_, _]]
565568 assert(hadoopRDD.partitions.length === expectedPartitionNum)
566569 }
567570
@@ -575,15 +578,15 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
575578
576579 // Ensure that if no split is empty, we don't lose any splits
577580 testIgnoreEmptySplits(
578- data = Array ((" key1 " , " a" ), (" key2 " , " a" ), (" key3 " , " b" )),
581+ data = Array ((" 1 " , " a" ), (" 2 " , " a" ), (" 3 " , " b" )),
579582 numSlices = 2 ,
580583 outputSuffix = 1 ,
581584 checkPart = " part-r-00001" ,
582585 expectedPartitionNum = 2 )
583586
584587 // Ensure that if part of the splits are empty, we remove the splits correctly
585588 testIgnoreEmptySplits(
586- data = Array ((" key1 " , " a" ), (" key2 " , " a " )),
589+ data = Array ((" 1 " , " a" ), (" 2 " , " b " )),
587590 numSlices = 5 ,
588591 outputSuffix = 2 ,
589592 checkPart = " part-r-00004" ,
0 commit comments