beliefer commented on code in PR #43505:
URL: https://github.com/apache/spark/pull/43505#discussion_r1371671171
##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -747,11 +747,14 @@ private[spark] object Utils
hadoopConf: Configuration,
fileOverwrite: Boolean,
filename: Option[String] = None): Unit = {
+ if (!fs.exists(path)) {
+ throw new FileNotFoundException(s"$path not found")
+ }
if (!targetDir.exists() && !targetDir.mkdir()) {
throw new IOException(s"Failed to create directory ${targetDir.getPath}")
}
val dest = new File(targetDir, filename.getOrElse(path.getName))
- if (SparkHadoopUtil.isFile(fs, path)) {
+ if (fs.getFileStatus(path).isFile) {
Review Comment:
It seems `fs.exists(path) && fs.getFileStatus(path).isFile` have the same
semantics as origin `SparkHadoopUtil.isFile(fs, path)`.
--
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]