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/10/17 18:24:07 UTC

[GitHub] [spark] imback82 opened a new pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

imback82 opened a new pull request #34305:
URL: https://github.com/apache/spark/pull/34305


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   1. Move `DESCRIBE DATABASE/NAMESPACE` parsing tests to `DescribeNamespaceParserSuite`.
   2. Put common `DESCRIBE NAMESPACE` tests into one trait `org.apache.spark.sql.execution.command. DescribeNamespaceSuiteBase`, and put datasource specific tests to the `v1.DescribeNamespaceSuite` and `v2.DescribeNamespaceSuite`.
   
   The changes follow the approach of #30287.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   1. The unification will allow to run common `DESCRIBE NAMESPACE` tests for both DSv1/Hive DSv1 and DSv2
   2. We can detect missing features and differences between DSv1 and DSv2 implementations.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Existing unit tests and new tests.


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945179030


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48811/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950422609


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144568/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950692505


   **[Test build #144583 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144583/testReport)** for PR 34305 at commit [`cecd0a6`](https://github.com/apache/spark/commit/cecd0a65b6472de6baea362f30887d4f19028845).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945187853


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48811/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952083437


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49094/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952046271


   **[Test build #144624 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144624/testReport)** for PR 34305 at commit [`a8820ab`](https://github.com/apache/spark/commit/a8820abd45be0c10a7296acc00a66aa54020df60).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan closed pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #34305:
URL: https://github.com/apache/spark/pull/34305


   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950376566


   **[Test build #144568 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144568/testReport)** for PR 34305 at commit [`2640444`](https://github.com/apache/spark/commit/2640444646e41788788fd28ba604fe706eedb974).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] imback82 commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
imback82 commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735750294



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  protected def notFoundMsgPrefix: String
+
+  test("namespace does not exists") {
+    val ns = "db1"
+    val message = intercept[AnalysisException] {
+      sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$ns")
+    }.getMessage
+
+    assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))
+
+    sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")

Review comment:
       This is testing whether `IF EXISTS` is respected when the namespace doesn't exist (existing test). Do we still want to remove it?




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952137177


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49094/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] imback82 commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
imback82 commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952041984


   retest this please


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950393847


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49039/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945172779


   **[Test build #144332 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144332/testReport)** for PR 34305 at commit [`d44f56e`](https://github.com/apache/spark/commit/d44f56e1e1064f7ecf422fbcb59be780da8a3a8c).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] imback82 commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
imback82 commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945182403


   cc @cloud-fan @MaxGekk 


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950422015


   **[Test build #144568 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144568/testReport)** for PR 34305 at commit [`2640444`](https://github.com/apache/spark/commit/2640444646e41788788fd28ba604fe706eedb974).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945172779


   **[Test build #144332 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144332/testReport)** for PR 34305 at commit [`d44f56e`](https://github.com/apache/spark/commit/d44f56e1e1064f7ecf422fbcb59be780da8a3a8c).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950382813


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49039/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735766196



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  protected def notFoundMsgPrefix: String
+
+  test("namespace does not exists") {
+    val ns = "db1"
+    val message = intercept[AnalysisException] {
+      sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$ns")
+    }.getMessage
+
+    assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))
+
+    sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")

Review comment:
       OK seems we don't have existing tests cover this case. Let's add it back with a TODO to move it to `DropNameSpaceSuite` in the future when we have one.




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952523239


   thanks, merging to master!


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-951123796


   **[Test build #144595 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144595/testReport)** for PR 34305 at commit [`a8820ab`](https://github.com/apache/spark/commit/a8820abd45be0c10a7296acc00a66aa54020df60).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735388130



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  protected def notFoundMsgPrefix: String
+
+  test("namespace does not exists") {
+    val ns = "db1"
+    val message = intercept[AnalysisException] {
+      sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$ns")
+    }.getMessage
+
+    assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))
+
+    sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")

Review comment:
       We don't need to test `DROP NAMESPACE` here




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735763668



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  protected def notFoundMsgPrefix: String
+
+  test("namespace does not exists") {
+    val ns = "db1"
+    val message = intercept[AnalysisException] {
+      sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$ns")
+    }.getMessage
+
+    assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))
+
+    sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")

Review comment:
       Well, it should belong to `DropNamespaceSuite` if we have one.




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950694996


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144583/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945189960


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48811/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730736958



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.v1
+
+import org.apache.spark.sql.Row
+import org.apache.spark.sql.catalyst.catalog.CatalogUtils
+import org.apache.spark.sql.execution.command
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that checks V1
+ * table catalogs. The tests that cannot run for all V1 catalogs are located in more
+ * specific test suites:
+ *
+ *   - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *   - V1 Hive External catalog:
+ *     `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends command.DescribeNamespaceSuiteBase {
+  test("basic") {
+    val namespaceNames = Seq("db1", "`database`")
+    withNamespace(namespaceNames: _*) {
+      namespaceNames.foreach { ns =>
+        val dbNameWithoutBackTicks = cleanIdentifier(ns)

Review comment:
       ditto




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] MaxGekk commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r731103085



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DescribeNamespaceSuite.scala
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.sql.Row
+import org.apache.spark.sql.connector.catalog.SupportsNamespaces
+import org.apache.spark.sql.execution.command
+import org.apache.spark.sql.types.{BooleanType, MetadataBuilder, StringType, StructType}
+import org.apache.spark.util.Utils
+
+/**
+ * The class contains tests for the `DESCRIBE NAMESPACE` command to check V2 table catalogs.
+ */
+class DescribeNamespaceSuite extends command.DescribeNamespaceSuiteBase with CommandSuiteBase {
+  test("DescribeNamespace using v2 catalog") {
+    withNamespace("test_catalog.ns1.ns2") {

Review comment:
       Any reason for not using `catalog` like s"$catalog.ns1.ns2"

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  test("namespace does not exists") {
+    val databaseNames = Seq("db1", "`database`")
+    databaseNames.foreach { dbName =>
+      val dbNameWithoutBackTicks = cleanIdentifier(dbName)
+      val message = intercept[AnalysisException] {
+        sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$dbName")
+      }.getMessage
+
+      val prefix = if (catalogVersion == "V2") "Namespace" else "Database"

Review comment:
       You can follow to the existing approach:
   1. Define a method in the base trait
   2. Override it in catalog specific classes.
   
   For example https://github.com/apache/spark/blob/0494dc90af48ce7da0625485a4dc6917a244d580/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala#L41




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945189960


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48811/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945218066


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144332/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730734464



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  test("namespace does not exists") {
+    val databaseNames = Seq("db1", "`database`")
+    databaseNames.foreach { dbName =>
+      val dbNameWithoutBackTicks = cleanIdentifier(dbName)
+      val message = intercept[AnalysisException] {
+        sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$dbName")
+      }.getMessage
+
+      val prefix = if (catalogVersion == "V2") "Namespace" else "Database"

Review comment:
       Seems not need to. This is minor.




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730737706



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  test("namespace does not exists") {
+    val databaseNames = Seq("db1", "`database`")
+    databaseNames.foreach { dbName =>
+      val dbNameWithoutBackTicks = cleanIdentifier(dbName)

Review comment:
       Actually, checking backticks should be the work of parser test, I think we should focus on functionalities in this test suite, and test `db1` only.




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950389133


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49039/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950376566


   **[Test build #144568 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144568/testReport)** for PR 34305 at commit [`2640444`](https://github.com/apache/spark/commit/2640444646e41788788fd28ba604fe706eedb974).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950422609


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144568/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735391689



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  protected def notFoundMsgPrefix: String
+
+  test("namespace does not exists") {
+    val ns = "db1"
+    val message = intercept[AnalysisException] {
+      sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$ns")
+    }.getMessage
+
+    assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))
+
+    sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")

Review comment:
       ```suggestion
   ```




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952133598


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49094/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] imback82 commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
imback82 commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730465699



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  test("namespace does not exists") {
+    val databaseNames = Seq("db1", "`database`")
+    databaseNames.foreach { dbName =>
+      val dbNameWithoutBackTicks = cleanIdentifier(dbName)
+      val message = intercept[AnalysisException] {
+        sql(s"DESCRIBE NAMESPACE EXTENDED $catalog.$dbName")
+      }.getMessage
+
+      val prefix = if (catalogVersion == "V2") "Namespace" else "Database"

Review comment:
       Should I move to a specific test suite (v1 and v2) so that the difference is clear?




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730739648



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.v1
+
+import org.apache.spark.sql.Row
+import org.apache.spark.sql.catalyst.catalog.CatalogUtils
+import org.apache.spark.sql.execution.command
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that checks V1
+ * table catalogs. The tests that cannot run for all V1 catalogs are located in more
+ * specific test suites:
+ *
+ *   - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *   - V1 Hive External catalog:
+ *     `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends command.DescribeNamespaceSuiteBase {
+  test("basic") {
+    val namespaceNames = Seq("db1", "`database`")
+    withNamespace(namespaceNames: _*) {
+      namespaceNames.foreach { ns =>
+        val dbNameWithoutBackTicks = cleanIdentifier(ns)
+        val location = getDBPath(dbNameWithoutBackTicks)
+
+        sql(s"CREATE NAMESPACE $ns")
+
+        checkAnswer(
+          sql(s"DESCRIBE NAMESPACE EXTENDED $ns")
+            .toDF("key", "value")
+            .where("key not like 'Owner%'"), // filter for consistency with in-memory catalog
+          Row("Database Name", dbNameWithoutBackTicks) ::
+            Row("Comment", "") ::
+            Row("Location", CatalogUtils.URIToString(location)) ::

Review comment:
       We don't need to check the default database location in `DescribeNamespaceSuite`. Let's just check that this `Location` row exists. Then we can remove `getDBPath` as well.




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950702057


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49054/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950702057


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49054/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950692505


   **[Test build #144583 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144583/testReport)** for PR 34305 at commit [`cecd0a6`](https://github.com/apache/spark/commit/cecd0a65b6472de6baea362f30887d4f19028845).


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945217743


   **[Test build #144332 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144332/testReport)** for PR 34305 at commit [`d44f56e`](https://github.com/apache/spark/commit/d44f56e1e1064f7ecf422fbcb59be780da8a3a8c).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `trait CommandTestUtils extends SQLTestUtils `
     * `abstract class DDLSuite extends QueryTest with CommandTestUtils `
     * `class DescribeNamespaceParserSuite extends AnalysisTest `
     * `trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils `
     * `trait DescribeNamespaceSuiteBase extends command.DescribeNamespaceSuiteBase `
     * `class DescribeNamespaceSuite extends command.DescribeNamespaceSuiteBase with CommandSuiteBase `


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-945218066


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144332/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] imback82 commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
imback82 commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952139228


   GA shows tests are passing: https://github.com/imback82/spark-4/actions/runs/1382032814 


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r730736281



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceSuiteBase.scala
##########
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+import org.apache.spark.sql.{AnalysisException, QueryTest}
+
+/**
+ * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that check V1 and V2
+ * table catalogs. The tests that cannot run for all supported catalogs are located in more
+ * specific test suites:
+ *
+ *   - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DescribeNamespaceSuite`
+ *   - V1 table catalog tests:
+ *     `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuiteBase`
+ *     - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DescribeNamespaceSuite`
+ *     - V1 Hive External catalog:
+*        `org.apache.spark.sql.hive.execution.command.DescribeNamespaceSuite`
+ */
+trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils {
+  override val command = "DESCRIBE NAMESPACE"
+
+  test("namespace does not exists") {
+    val databaseNames = Seq("db1", "`database`")
+    databaseNames.foreach { dbName =>
+      val dbNameWithoutBackTicks = cleanIdentifier(dbName)

Review comment:
       I'd like to write test in this way so that we don't need `cleanIdentifier`
   ```
   Seq("db1", "`db1`").foreach {
     ...
     assert(message.contains(... 'db1' ...
   }
   ```




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-952137177


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49094/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950393847


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/49039/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] cloud-fan commented on a change in pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #34305:
URL: https://github.com/apache/spark/pull/34305#discussion_r735390077



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeNamespaceParserSuite.scala
##########
@@ -0,0 +1,36 @@
+/*
+ * 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
+
+import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedNamespace}
+import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan
+import org.apache.spark.sql.catalyst.plans.logical.DescribeNamespace
+
+class DescribeNamespaceParserSuite extends AnalysisTest {
+  test("describe namespace") {
+    val sql1 = "DESCRIBE NAMESPACE EXTENDED a.b"
+    val sql2 = "DESCRIBE NAMESPACE a.b"
+    val sql3 = "DESCRIBE NAMESPACE cat.`database`"

Review comment:
       let's test that `DESCRIBE DATABASE`, `DESCRIBE SCHEMA` also work




-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950694957


   **[Test build #144583 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144583/testReport)** for PR 34305 at commit [`cecd0a6`](https://github.com/apache/spark/commit/cecd0a65b6472de6baea362f30887d4f19028845).
    * This patch **fails Scala style tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] AmplabJenkins commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950694996


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144583/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] SparkQA commented on pull request #34305: [SPARK-37031][SQL][TESTS] Unify v1 and v2 DESCRIBE NAMESPACE tests

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34305:
URL: https://github.com/apache/spark/pull/34305#issuecomment-950702032


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49054/
   


-- 
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: reviews-unsubscribe@spark.apache.org

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