We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3192d9 commit 20210b9Copy full SHA for 20210b9
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileWriteBuilder.scala
@@ -16,6 +16,7 @@
16
*/
17
package org.apache.spark.sql.execution.datasources.v2
18
19
+import java.io.IOException
20
import java.util.UUID
21
22
import scala.collection.JavaConverters._
@@ -83,7 +84,9 @@ abstract class FileWriteBuilder(options: DataSourceOptions)
83
84
null
85
86
case SaveMode.Overwrite =>
- committer.deleteWithJob(fs, path, true)
87
+ if (fs.exists(path) && !committer.deleteWithJob(fs, path, true)) {
88
+ throw new IOException(s"Unable to clear directory $path prior to writing to it")
89
+ }
90
committer.setupJob(job)
91
new FileBatchWrite(job, description, committer)
92
0 commit comments