dchvn commented on a change in pull request #34819: URL: https://github.com/apache/spark/pull/34819#discussion_r772780721
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DropNamespaceSuite.scala ########## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.SparkException +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `DROP NAMESPACE` command to check V2 table catalogs. + */ +class DropNamespaceSuite extends command.DropNamespaceSuiteBase with CommandSuiteBase { + override protected def assertDropFails(): Unit = { + val e = intercept[SparkException] { Review comment: > Can we leave a TODO to unify the error? I think both v1 and v2 commands should throw `AnalysisException`, and the error message should only have one difference between v1 and v2: `Cannot drop a non-empty namespace: ...` vs `Cannot drop a non-empty database: ...` The error message of Hive External Catalog test is `Database ns is not empty. One or more tables exist.`, which is identical to the error message of v1. So we should keep this and remove TODO, or we should unify the error of v1, v2 test and then seperate the hive's one. Thanks. @cloud-fan @huaxingao -- 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]
