WinkerDu commented on a change in pull request #29000:
URL: https://github.com/apache/spark/pull/29000#discussion_r478796737
##########
File path:
core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala
##########
@@ -106,13 +112,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 =>
+ if (dynamicPartitionOverwrite) {
+ assert(dir.isDefined,
+ "The dataset to be written must be partitioned when
dynamicPartitionOverwrite is true.")
+ partitionPaths += dir.get
+ }
new Path(Option(f.getWorkPath).map(_.toString).getOrElse(path))
Review comment:
IFAIKļ¼`assert(dir.isDefined, ...)` already avoid this case,
`dir.isDefined` means` !dir.isEmpty`, correct me if wrong :)
----------------------------------------------------------------
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]