cloud-fan commented on code in PR #37679:
URL: https://github.com/apache/spark/pull/37679#discussion_r975361715
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -1846,23 +1848,23 @@ class SessionCatalog(
// -----------------
/**
- * Drop all existing databases (except "default"), tables, partitions and
functions,
- * and set the current database to "default".
+ * Drop all existing databases (except defaultDatabase), tables, partitions
and functions,
+ * and set the current database to defaultDatabase.
*
* This is mainly used for tests.
*/
def reset(): Unit = synchronized {
- setCurrentDatabase(DEFAULT_DATABASE)
- externalCatalog.setCurrentDatabase(DEFAULT_DATABASE)
- listDatabases().filter(_ != DEFAULT_DATABASE).foreach { db =>
+ setCurrentDatabase(defaultDatabase)
+ externalCatalog.setCurrentDatabase(defaultDatabase)
+ listDatabases().filter(_ != defaultDatabase).foreach { db =>
dropDatabase(db, ignoreIfNotExists = false, cascade = true)
}
- listTables(DEFAULT_DATABASE).foreach { table =>
+ listTables(defaultDatabase).foreach { table =>
Review Comment:
ditto
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -1846,23 +1848,23 @@ class SessionCatalog(
// -----------------
/**
- * Drop all existing databases (except "default"), tables, partitions and
functions,
- * and set the current database to "default".
+ * Drop all existing databases (except defaultDatabase), tables, partitions
and functions,
+ * and set the current database to defaultDatabase.
*
* This is mainly used for tests.
*/
def reset(): Unit = synchronized {
- setCurrentDatabase(DEFAULT_DATABASE)
- externalCatalog.setCurrentDatabase(DEFAULT_DATABASE)
- listDatabases().filter(_ != DEFAULT_DATABASE).foreach { db =>
+ setCurrentDatabase(defaultDatabase)
+ externalCatalog.setCurrentDatabase(defaultDatabase)
+ listDatabases().filter(_ != defaultDatabase).foreach { db =>
dropDatabase(db, ignoreIfNotExists = false, cascade = true)
}
- listTables(DEFAULT_DATABASE).foreach { table =>
+ listTables(defaultDatabase).foreach { table =>
dropTable(table, ignoreIfNotExists = false, purge = false)
}
// Temp functions are dropped below, we only need to drop permanent
functions here.
- externalCatalog.listFunctions(DEFAULT_DATABASE, "*").map { f =>
- FunctionIdentifier(f, Some(DEFAULT_DATABASE))
+ externalCatalog.listFunctions(defaultDatabase, "*").map { f =>
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]