WinkerDu commented on a change in pull request #29000:
URL: https://github.com/apache/spark/pull/29000#discussion_r460676976
##########
File path:
core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala
##########
@@ -106,15 +106,13 @@ class HadoopMapReduceCommitProtocol(
val filename = getFilename(taskContext, ext)
val stagingDir: Path = committer match {
- case _ if dynamicPartitionOverwrite =>
- assert(dir.isDefined,
- "The dataset to be written must be partitioned when
dynamicPartitionOverwrite is true.")
- partitionPaths += dir.get
- this.stagingDir
// For FileOutputCommitter it has its own staging path called "work
path".
case f: FileOutputCommitter =>
+ handleDynamicPartitionOverwrite(dir)
new Path(Option(f.getWorkPath).map(_.toString).getOrElse(path))
- case _ => new Path(path)
+ case _ =>
+ handleDynamicPartitionOverwrite(dir)
Review comment:
Since this pr leverages FileOutputCommitter to deal with commit
collision, only handle dynamic partition overwrite in the first branch.
BTW, it seems all committers practically used in Spark are derived from
'FIleOutputCommiter'
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]