File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
core/src/test/scala/org/apache/spark Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package org.apache.spark
19
19
20
20
import java .io .{File , FileWriter }
21
21
22
+ import org .apache .spark .deploy .SparkHadoopUtil
22
23
import org .apache .spark .input .PortableDataStream
23
24
import org .apache .spark .storage .StorageLevel
24
25
@@ -506,8 +507,9 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
506
507
job.setOutputKeyClass(classOf [String ])
507
508
job.setOutputValueClass(classOf [String ])
508
509
job.setOutputFormatClass(classOf [NewTextOutputFormat [String , String ]])
509
- job.getConfiguration.set(" mapred.output.dir" , tempDir.getPath + " /outputDataset_new" )
510
- randomRDD.saveAsNewAPIHadoopDataset(job.getConfiguration)
510
+ val jobConfig = SparkHadoopUtil .get.getConfigurationFromJobContext(job)
511
+ jobConfig.set(" mapred.output.dir" , tempDir.getPath + " /outputDataset_new" )
512
+ randomRDD.saveAsNewAPIHadoopDataset(jobConfig)
511
513
assert(new File (tempDir.getPath + " /outputDataset_new/part-r-00000" ).exists() === true )
512
514
}
513
515
You can’t perform that action at this time.
0 commit comments