Github user XuefengWu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3293#discussion_r20418986
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -759,18 +759,9 @@ private[spark] object Utils extends Logging {
         if (file != null) {
           try {
             if (file.isDirectory && !isSymlink(file)) {
    -          var savedIOException: IOException = null
    -          for (child <- listFilesSafely(file)) {
    -            try {
    -              deleteRecursively(child)
    -            } catch {
    -              // In case of multiple exceptions, only last one will be 
thrown
    -              case ioe: IOException => savedIOException = ioe
    -            }
    -          }
    -          if (savedIOException != null) {
    -            throw savedIOException
    -          }
    +          listFilesSafely(file).map(child => 
Try(deleteRecursively(child))).
    --- End diff --
    
    `Iterator(1,2,3).map{i => println(i);i}` nothing happened for a lazy 
collection until consume asked.


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

Reply via email to