Peng-Lei commented on a change in pull request #33339:
URL: https://github.com/apache/spark/pull/33339#discussion_r698138594



##########
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:
       > To be clear, `ALTER DATABASE db-not-exist` previously throws 
`NoSuchDatabaseException`, right?
   > 
   right.
   
   > After this change, as `db-not-exist` will be taken in catalog resolving 
`CatalogAndNamespace`, it will throw `AnalysisException`, right? So you changed 
the test to `db_not_exist` so it won't fail catalog name validation.
   > 
   right.
   
   > So what I mean is, now `ALTER DATABASE db-not-exist` throws 
`AnalysisException`, due to `db-not-exist` fails catalog name validation. But 
what if `ALTER DATABASE catalog.db-not-exist`? Does it still throw 
`NoSuchDatabaseException` like before?
   > 
   if `ALTER DATABASE catalog.db-not-exist`. it still throw 
`NoSuchDatabaseException` like before.
   
   > If so, the two commands are pretty close or the same, as they both ask to 
alter a non-existing database. But one throws `AnalysisException`, and another 
one throws `NoSuchDatabaseException`?
   > 
   right.
   
   > I don't run it to validate. But from above description, seems it is what 
will happen?
   
   You are right.
   
   




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

Reply via email to