cloud-fan commented on code in PR #47592:
URL: https://github.com/apache/spark/pull/47592#discussion_r1704810269
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala:
##########
@@ -107,16 +107,19 @@ class CatalogManager(
}
def setCurrentNamespace(namespace: Array[String]): Unit = synchronized {
Review Comment:
how about
```
private def assertNamespaceExist(namespace: Array[String]): Unit = {
currentCatalog match {
case catalog: SupportsNamespaces if !catalog.namespaceExists(namespace)
=>
...
case _ =>
}
}
def setCurrentNamespace(namespace: Array[String]): Unit = synchronized {
if (isSessionCatalog(currentCatalog) && namespace.length == 1) {
v1SessionCatalog.validateGlobalTempView(namespace.head)
assertNamespaceExist(namespace)
v1SessionCatalog.setCurrentDatabaseWithoutCheck(namespace.head)
} else {
assertNamespaceExist(namespace)
}
_currentNamespace = Some(namespace)
}
```
--
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]