panbingkun commented on code in PR #43505:
URL: https://github.com/apache/spark/pull/43505#discussion_r1377174840
##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -673,7 +673,7 @@ private[spark] object Utils
throw new IOException(s"Failed to create directory ${targetDir.getPath}")
}
val dest = new File(targetDir, filename.getOrElse(path.getName))
- if (fs.isFile(path)) {
+ if (fs.getFileStatus(path).isFile) {
Review Comment:
Although the semantics of this sentence are different from the original, our
function maintains the same semantics.
In the original logic, if `path` does not exist, it will go to the `else
statement`, and calling `fs.listStatus(path)` will also generate an exception:
`FileNotFoundException`.
--
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]