advancedxy commented on a change in pull request #25863: 
[WIP][SPARK-29037][CORE][SQL] For static partition overwrite, spark may give 
duplicate result.
URL: https://github.com/apache/spark/pull/25863#discussion_r327992313
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala
 ##########
 @@ -263,4 +281,108 @@ case class InsertIntoHadoopFsRelationCommand(
       }
     }.toMap
   }
+
+  /**
+   * Detect the conflict when there are several InsertIntoHadoopFsRelation 
operations
+   * write concurrently.
+   */
+  private def detectConflict(
+      fs: FileSystem,
+      path: Path,
+      isOverwrite: Boolean,
+      staticPartitionKVs: Seq[(String, String)]): Unit = {
+    for (i <- 0 until partitionColumns.size) {
+      val checkedStagingPath = ListBuffer(s".spark-staging-overwrite-$i")
+      if (isOverwrite) {
+        checkedStagingPath += s".spark-staging-append-$i"
 
 Review comment:
   what about two concurrent job both appending data to the same partitions? 
   
   In current approach, we didn't detect the conflict? I think we have to 
disable concurrent append to the same partition also.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to