Github user sujith71955 commented on a diff in the pull request: https://github.com/apache/spark/pull/22466#discussion_r219442479 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala --- @@ -2348,4 +2348,41 @@ class HiveDDLSuite } } } + + test("SPARK-25464 Drop Database check location after dropping external Database") { + val catalog = spark.sessionState.catalog + val dbName = "dbwithcustomlocation" + withTempDir { tmpDir => + val path = new Path(tmpDir.getCanonicalPath) + val fs = path.getFileSystem(new Configuration) + try { + sql(s"CREATE DATABASE $dbName Location '${ path.toUri }'") + val db1 = catalog.getDatabaseMetadata(dbName) + assert(db1.properties.getOrElse("isExternal","empty").equals("true")) + val client = + spark.sharedState.externalCatalog.unwrapped.asInstanceOf[HiveExternalCatalog].client + client.dropDatabase(dbName,false,true) + assert(fs.exists(path)) + assert(!catalog.databaseExists(dbName)) + } + finally { --- End diff -- please pull finally to 1 level up inline with the close brace of try
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org