Peng-Lei commented on a change in pull request #33339:
URL: https://github.com/apache/spark/pull/33339#discussion_r698126897
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
##########
@@ -799,7 +799,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils
{
}
intercept[NoSuchDatabaseException] {
- sql(s"ALTER DATABASE `db-not-exist` SET LOCATION
'${tmpDir.toURI}'")
+ sql(s"ALTER DATABASE `db_not_exist` SET LOCATION
'${tmpDir.toURI}'")
Review comment:
@viirya
The testcase is `ALTER DATABASE `db-not-exist` SET LOCATION
'${tmpDir.toURI}` , so it will call `visitSetNamespaceLocation` first.
Then `UnresolvedNamespace` to `ResolvedNamespace`, it will call the the rule
`ResolveNamespace`. It goes to the last case branch.
```scala
case UnresolvedNamespace(CatalogAndNamespace(catalog, ns)) =>
ResolvedNamespace(catalog, ns)
```
In `CatalogAndNamespace` it will call
`Some((catalogManager.catalog(nameParts.head), nameParts.tail))`, I add the
check logic in method `catalogManager.catalog`.
In the test case , The nameParts.length == 1 and nameParts.head ==
`db-not-exist`, The name is not valid, so it will throw a AnalysisException.
The original logic will throw a `CatalogNotFoundException`, then use
`currentCatalog`, `db-not-exist` will as a name of DataBase.
Maybe I'm wrong ?
--
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]