Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/4880#discussion_r25743237
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -643,7 +645,12 @@ private[spark] object Utils extends Logging {
fileOverwrite)
} else {
val in = fs.open(innerPath)
- val targetFile = new File(targetDir, innerPath.getName)
+ val targetFile: File =
+ if (!filename.isEmpty) {
+ new File(targetDir, filename)
+ } else {
+ new File(targetDir, innerPath.getName)
+ }
--- End diff --
> If the path passed to it is a directory, it will recursively call itself
without setting filename
That's not actually true. If you call `listStatus` on a directory it will
list the directory's contents and not include the directory itself. So if the
directory contains multiple files they will all go into the else case in L646
and be renamed to the same thing.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]