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

    https://github.com/apache/spark/pull/12081#discussion_r60667613
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -348,4 +363,99 @@ class HiveDDLSuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
           }
         }
       }
    +
    +  test("create/drop database - location") {
    +    val catalog = sqlContext.sessionState.catalog
    +    withTempDir { tmpDir =>
    +      val dbName = "db1"
    +      val tabName = "tab1"
    +      val path = catalog.createDatabasePath(dbName, 
Option(tmpDir.toString))
    +      val fs = new 
Path(path).getFileSystem(hiveContext.sessionState.hiveconf)
    +      withTable(tabName) {
    +        assert(tmpDir.listFiles.isEmpty)
    +        sql(s"CREATE DATABASE $dbName Location '$tmpDir'")
    +        val db1 = catalog.getDatabaseMetadata(dbName)
    +        assert(db1 == CatalogDatabase(
    +          dbName,
    +          "",
    +          path,
    +          Map.empty))
    +        sql("USE db1")
    --- End diff --
    
    After each test, we reset everything, as shown in the line:
    
https://github.com/apache/spark/pull/12081/files#diff-b7094baa12601424a5d19cb930e3402fR36


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