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

    https://github.com/apache/spark/pull/18309#discussion_r122649017
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala ---
    @@ -126,6 +127,27 @@ private[sql] trait SQLTestUtils
       }
     
       /**
    +   * Creates the requested number of temporary path (without creating the 
actual file/directory),
    --- End diff --
    
    I wanted to create a multi-path version of an existing withTempPath 
function. That function returns a *valid*, but non-existent path. The comments 
and path.delete() part of the implementation came from there.
    
    /**
       * Generates a temporary path without creating the actual file/directory, 
then pass it to `f`. If
       * a file/directory is created there by `f`, it will be delete after `f` 
returns.
       *
       * @todo Probably this method should be moved to a more general place
       */
      protected def withTempPath(f: File => Unit): Unit = {
        val path = Utils.createTempDir()
        path.delete()
        try f(path) finally Utils.deleteRecursively(path)
      }


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to