viirya commented on a change in pull request #33339:
URL: https://github.com/apache/spark/pull/33339#discussion_r698132290



##########
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:
       Seems `validateName` was only used for validation when creating 
database, table before. So previously `ALTER DATABASE db-not-exist` didn't 
trigger the validation. It just simply checks the existing of the database 
`db-not-exist`.
   
   So after this change, `ALTER DATABASE db-not-exist` will trigger catalog 
name check even `db-not-exist` here doesn't indicate catalog name but database 
name.
   
   That being said, a command like ``ALTER DATABASE db-not-exist` will throw 
the `AnalysisException`, not `NoSuchDatabaseException` like before.
   
   What happens if the database name is with catalog? As we don't validate 
database name for this, if it throws `NoSuchDatabaseException`, seems not 
consistent.




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