You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/02 05:58:49 UTC

[GitHub] [spark] beliefer commented on a change in pull request #31619: [WIP][SPARK-33600] Group exception messages in execution/datasources/v2

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



##########
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:
       `NoSuchNamespaceException` is generated during execute and should be placed in `QueryExecutionErrors`.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org