beliefer commented on a change in pull request #31619:
URL: https://github.com/apache/spark/pull/31619#discussion_r586984369



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DropNamespaceExec.scala
##########
@@ -43,17 +42,15 @@ case class DropNamespaceExec(
       if (!cascade) {
         if (catalog.asTableCatalog.listTables(ns).nonEmpty
           || nsCatalog.listNamespaces(ns).nonEmpty) {
-          throw new SparkException(
-            s"Cannot drop a non-empty namespace: ${namespace.quoted}. " +
-              "Use CASCADE option to drop a non-empty namespace.")
+          throw 
QueryExecutionErrors.cannotDropNonemptyNamespaceError(namespace)
         }
       }
 
       if (!nsCatalog.dropNamespace(ns)) {
-        throw new SparkException(s"Failed to drop a namespace: 
${namespace.quoted}.")
+        throw QueryExecutionErrors.cannotDropNonemptyNamespaceError(namespace)
       }
     } else if (!ifExists) {
-      throw new NoSuchNamespaceException(ns)
+      throw QueryCompilationErrors.noSuchNamespaceError(ns)

Review comment:
       I got it. Thanks!




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

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