AngersZhuuuu commented on a change in pull request #35254:
URL: https://github.com/apache/spark/pull/35254#discussion_r788393183



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala
##########
@@ -105,10 +105,22 @@ case class InsertIntoHadoopFsRelationCommand(
     }
 
     val jobId = java.util.UUID.randomUUID().toString
+    // For dynamic partition overwrite, FileOutputCommitter's output path is 
staging path, files
+    // will be renamed from staging path to final output path during commit job
+    val committerOutputPath = if (dynamicPartitionOverwrite) {
+      FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
+        .makeQualified(fs.getUri, fs.getWorkingDirectory)
+    } else if (staticPartitions.size == partitionColumns.length) {
+      val defaultLocation = qualifiedOutputPath.suffix(
+        "/" + PartitioningUtils.getPathFragment(staticPartitions, 
partitionColumns)).toString
+      customPartitionLocations.getOrElse(staticPartitions, defaultLocation)

Review comment:
       Here will change the value of committerOutputPath in static partition 
insert to partition location. It's reasonable.
   This value is only used in 
    1.    FileOutputFormat.setOutputPath(job, new Path(outputSpec.outputPath))
    2.   Assigned to WriteJobDescription's path parameter, it's not used at all




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to