LuciferYang commented on code in PR #43505:
URL: https://github.com/apache/spark/pull/43505#discussion_r1370070844


##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -751,7 +751,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.getFileStatus(path).isFile) {
+    if (SparkHadoopUtil.isFile(fs, path)) {

Review Comment:
   Are there some issues with the original logic in some places? It might need 
to be carefully considered. For instance, here, if the `path` does not exist, 
it would enter the else branch, and then a `FileNotFoundException` would be 
thrown. Although the result hasn't changed, perhaps the `FileNotFoundException` 
should be thrown earlier.



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