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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala
##########
@@ -44,8 +44,12 @@ class CatalogManager(
   import CatalogV2Util._
 
   private val catalogs = mutable.HashMap.empty[String, CatalogPlugin]
+  private val validNameFormat = "([\\w_]+)".r
 
   def catalog(name: String): CatalogPlugin = synchronized {
+    if (!validNameFormat.pattern.matcher(name).matches()) {
+      throw QueryCompilationErrors.invalidNameForCatalogError(name)
+    }

Review comment:
       The verification of name may be a bit strict. But as an identifier. I 
think the basic check is needed like follow:
   ```scala
   name.trim.isEmpty
   ```




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