You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/31 01:21:17 UTC

[GitHub] [spark] viirya commented on a change in pull request #26312: [SPARK-29649][SQL] Stop task set if FileAlreadyExistsException was thrown when writing to output file

viirya commented on a change in pull request #26312: [SPARK-29649][SQL] Stop task set if FileAlreadyExistsException was thrown when writing to output file
URL: https://github.com/apache/spark/pull/26312#discussion_r340926443
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
 ##########
 @@ -735,4 +737,35 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
       assert(msg.contains("Cannot write nullable values to non-null column 's'"))
     }
   }
+
+  test("SPARK-29649: Stop task set if FileAlreadyExistsException was thrown") {
+    withSQLConf("fs.file.impl" -> classOf[FileExistingTestFileSystem].getName,
+        "fs.file.impl.disable.cache" -> "true") {
+      withTable("t") {
+        sql(
+          """
+            |create table t(i int, part1 int) using parquet
+            |partitioned by (part1)
+          """.stripMargin)
+
+        val df = Seq((1, 1)).toDF("i", "part1")
+        val err = intercept[SparkException] {
+          df.write.mode("overwrite").format("parquet").insertInto("t")
+        }
+        assert(err.getCause.getMessage.contains("can not write to output file: " +
+          "org.apache.hadoop.fs.FileAlreadyExistsException"))
 
 Review comment:
   I tried to test with max failures config, however in the test max failure is fixed at 1. Currently this checks the exception message is thrown by the added code path in TaskSetManager.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org