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

    https://github.com/apache/spark/pull/20147#discussion_r159939270
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala
 ---
    @@ -85,6 +93,34 @@ class HiveExternalCatalogVersionsSuite extends 
SparkSubmitTestUtils {
         new File(tmpDataDir, name).getCanonicalPath
       }
     
    +  private def getFileFromUrl(urlString: String, targetDir: String, 
filename: String): Unit = {
    +    val conf = new SparkConf
    +    // if the caller passes the name of an existing file, we want 
doFetchFile to write over it with
    +    // the contents from the specified url.
    +    conf.set("spark.files.overwrite", "true")
    +    val securityManager = new SecurityManager(conf)
    +    val hadoopConf = new Configuration
    +
    +    val outDir = new File(targetDir)
    +    if (!outDir.exists()) {
    +      outDir.mkdirs()
    +    }
    +
    +    // propagate exceptions up to the caller of getFileFromUrl
    --- End diff --
    
    We generally don't add these kind of comments since it's implied in every 
statement outside of a try...catch.


---

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

Reply via email to