Skip to content

Commit

Permalink
Fix violation in FileSuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Aug 29, 2015
1 parent 58dd847 commit d9cb6df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/test/scala/org/apache/spark/FileSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark

import java.io.{File, FileWriter}

import org.apache.spark.deploy.SparkHadoopUtil
import org.apache.spark.input.PortableDataStream
import org.apache.spark.storage.StorageLevel

Expand Down Expand Up @@ -506,8 +507,9 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
job.setOutputKeyClass(classOf[String])
job.setOutputValueClass(classOf[String])
job.setOutputFormatClass(classOf[NewTextOutputFormat[String, String]])
job.getConfiguration.set("mapred.output.dir", tempDir.getPath + "/outputDataset_new")
randomRDD.saveAsNewAPIHadoopDataset(job.getConfiguration)
val jobConfig = SparkHadoopUtil.get.getConfigurationFromJobContext(job)
jobConfig.set("mapred.output.dir", tempDir.getPath + "/outputDataset_new")
randomRDD.saveAsNewAPIHadoopDataset(jobConfig)
assert(new File(tempDir.getPath + "/outputDataset_new/part-r-00000").exists() === true)
}

Expand Down

0 comments on commit d9cb6df

Please sign in to comment.