Skip to content

Commit 716c88a

Browse files
CodingCatpwendell
authored andcommitted
SPARK-2039: apply output dir existence checking for all output formats
https://issues.apache.org/jira/browse/SPARK-2039 apply output dir existence checking for all output formats Author: CodingCat <[email protected]> Closes apache#1088 from CodingCat/SPARK-2039 and squashes the following commits: c52747a [CodingCat] apply output dir existence checking for all output formats
1 parent 119b06a commit 716c88a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,7 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
787787
val outfmt = job.getOutputFormatClass
788788
val jobFormat = outfmt.newInstance
789789

790-
if (self.conf.getBoolean("spark.hadoop.validateOutputSpecs", true) &&
791-
jobFormat.isInstanceOf[NewFileOutputFormat[_, _]]) {
790+
if (self.conf.getBoolean("spark.hadoop.validateOutputSpecs", true)) {
792791
// FileOutputFormat ignores the filesystem parameter
793792
jobFormat.checkOutputSpecs(job)
794793
}
@@ -854,8 +853,7 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
854853
logDebug("Saving as hadoop file of type (" + keyClass.getSimpleName + ", " +
855854
valueClass.getSimpleName + ")")
856855

857-
if (self.conf.getBoolean("spark.hadoop.validateOutputSpecs", true) &&
858-
outputFormatInstance.isInstanceOf[FileOutputFormat[_, _]]) {
856+
if (self.conf.getBoolean("spark.hadoop.validateOutputSpecs", true)) {
859857
// FileOutputFormat ignores the filesystem parameter
860858
val ignoredFs = FileSystem.get(conf)
861859
conf.getOutputFormat.checkOutputSpecs(ignoredFs, conf)

0 commit comments

Comments
 (0)