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/09/29 04:58:55 UTC

[GitHub] [spark] imback82 opened a new pull request #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   <!--
   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.
   -->
   This PR proposes to use V2 commands as default as outlined in [SPARK-36588](https://issues.apache.org/jira/browse/SPARK-36588), and this PR migrates `SHOW TABLES` to use v2 command by default.
   
   ### 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.
   -->
   It's been a while since we introduced the v2 commands,  and it seems reasonable to use v2 commands by default even for the session catalog, with a legacy config to fall back to the v1 commands.
   
   ### 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, the user can use v1 command by setting `spark.sql.legacy.useV1Command` to `true`.
   
   ### 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.
   -->
   Added unit 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] cloud-fan commented on a change in pull request #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -143,6 +163,8 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
  * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog.
  */
 class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase {
+  override def version: String = super[ShowTablesSuiteBase].version

Review comment:
       can we remove this line if we make `ShowTablesSuiteBase` an abstract class?




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala
##########
@@ -33,7 +33,8 @@ case class ShowTablesExec(
     output: Seq[Attribute],
     catalog: TableCatalog,
     namespace: Seq[String],
-    pattern: Option[String]) extends V2CommandExec with LeafExecNode {
+    pattern: Option[String],
+    listTempViews: Option[String] => Seq[Identifier]) extends V2CommandExec with LeafExecNode {

Review comment:
       This is removed now.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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






-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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






-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   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] cloud-fan closed pull request #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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






-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       what's the behavior today (with v1 commands)?




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #144042 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144042/testReport)** for PR 34137 at commit [`bce9e70`](https://github.com/apache/spark/commit/bce9e70f5a14548b19f6c72eb195c83cea0d25bd).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils `


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143835 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143835/testReport)** for PR 34137 at commit [`94fa7d1`](https://github.com/apache/spark/commit/94fa7d13d3fdd0305e4de50a6af919dbdc4d37c0).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       Introduced `withCurrentCatalogAndNamespace` and used it in the test that was changing current database.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143830 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143830/testReport)** for PR 34137 at commit [`0c968ff`](https://github.com/apache/spark/commit/0c968ff5f14dfa60945bf7c6210b6369f7bbeff3).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       Got 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] SparkQA commented on pull request #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       I think it makes more sense to reset to the default namespace/database (`default` for session catalog and `Array()` for v2 catalogs) if the namespace you are in is deleted.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143835 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143835/testReport)** for PR 34137 at commit [`94fa7d1`](https://github.com/apache/spark/commit/94fa7d13d3fdd0305e4de50a6af919dbdc4d37c0).
    * This patch **fails SparkR unit 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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143835 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143835/testReport)** for PR 34137 at commit [`94fa7d1`](https://github.com/apache/spark/commit/94fa7d13d3fdd0305e4de50a6af919dbdc4d37c0).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala
##########
@@ -40,10 +40,17 @@ case class ShowTablesExec(
     val tables = catalog.listTables(namespace.toArray)

Review comment:
       OK, makes sense.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -143,6 +163,8 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
  * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog.
  */
 class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase {
+  override def version: String = super[ShowTablesSuiteBase].version

Review comment:
       Yes, because both `ShowTablesSuiteBase` and `CommandSuiteBase` override `version`.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       Instead of calling `CatalogManager.reset` after each test, shall we find out the tests that sets current database and set it back at the end of test?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       Instead of calling `CatalogManager.reset` after each test, shall we find out the tests that set current database and set it back at the end of test?




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143705 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143705/testReport)** for PR 34137 at commit [`d301cab`](https://github.com/apache/spark/commit/d301cab8f52493a79f81d8108909d7b2ac580e86).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils with BeforeAndAfter `


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       @cloud-fan I need to add this because the current namespace is not reset even if the dropped namespace is the current namespace. (this introduced a bug in test, which I fixed below).
   
   If I have:
   ```
   sql("create database db")
   sql("create table spark_catalog.db ...")
   sql("use spark_catalog.db") // Current namespace is "db"
   sql("drop database db") // Current namespace is still "db"
   ```
   Should we fix above? I can fix it as a separate PR if the current behavior doesn't seem right.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -84,7 +105,7 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
         false -> "PARTITION(YEAR = 2015, Month = 1)"
       ).foreach { case (caseSensitive, partitionSpec) =>
         withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) {
-          val df = sql(s"SHOW TABLE EXTENDED LIKE 'part_table' $partitionSpec")
+          val df = sql(s"SHOW TABLE EXTENDED IN ns LIKE 'part_table' $partitionSpec")

Review comment:
       This seems like an existing bug, but this worked because the current namespace was never reset even when the namespace is dropped.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       V1 / V2 behaviors are the same since the current namespace is managed by `CatalogManager`. (`SessionCatalog` doesn't reset the current database when the current database is dropped). Let me check the postgre's behavior.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143705 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143705/testReport)** for PR 34137 at commit [`d301cab`](https://github.com/apache/spark/commit/d301cab8f52493a79f81d8108909d7b2ac580e86).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143830 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143830/testReport)** for PR 34137 at commit [`0c968ff`](https://github.com/apache/spark/commit/0c968ff5f14dfa60945bf7c6210b6369f7bbeff3).
    * This patch **fails Spark unit 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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #144042 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144042/testReport)** for PR 34137 at commit [`bce9e70`](https://github.com/apache/spark/commit/bce9e70f5a14548b19f6c72eb195c83cea0d25bd).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala
##########
@@ -33,7 +33,8 @@ case class ShowTablesExec(
     output: Seq[Attribute],
     catalog: TableCatalog,
     namespace: Seq[String],
-    pattern: Option[String]) extends V2CommandExec with LeafExecNode {
+    pattern: Option[String],
+    listTempViews: Option[String] => Seq[Identifier]) extends V2CommandExec with LeafExecNode {

Review comment:
       do we need to pass this? All `SparkPlan` can access the current spark session by calling `this.session`




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala
##########
@@ -33,7 +33,8 @@ case class ShowTablesExec(
     output: Seq[Attribute],
     catalog: TableCatalog,
     namespace: Seq[String],
-    pattern: Option[String]) extends V2CommandExec with LeafExecNode {
+    pattern: Option[String],
+    listTempViews: Option[String] => Seq[Identifier]) extends V2CommandExec with LeafExecNode {

Review comment:
       do we need to pass this? All `SparkPlan` can access the current spark session by calling `this.session`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       what's the behavior today (with v1 commands)?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -143,6 +163,8 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
  * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog.
  */
 class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase {
+  override def version: String = super[ShowTablesSuiteBase].version

Review comment:
       is this line needed?




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala
##########
@@ -40,10 +40,17 @@ case class ShowTablesExec(
     val tables = catalog.listTables(namespace.toArray)

Review comment:
       right now the behavior is like only the session catalog has temp views. In the future I think we should refine this behavior and always include temp views in `SHOW TABLES`'s output. 




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       `postgres` doesn't allow to drop the database you are in: `[23877] ERROR:  cannot drop the currently open database`.
   
   `mysql` resets the current database to `NULL`:
   ```
   CREATE DATABASE tmp;
   USE tmp;
   select database();
   drop database tmp;
   select database();
   
   database()
   tmp
   database()
   NULL
   ```
    




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -143,6 +163,8 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
  * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog.
  */
 class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase {
+  override def version: String = super[ShowTablesSuiteBase].version

Review comment:
       No, it will result in the same error: `class ShowTablesSuite inherits conflicting members:`




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #144042 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144042/testReport)** for PR 34137 at commit [`bce9e70`](https://github.com/apache/spark/commit/bce9e70f5a14548b19f6c72eb195c83cea0d25bd).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       @cloud-fan I need to add this because the current namespace is not reset even if the dropped namespace is the current namespace. (this introduced a bug in test, which I fixed below).
   
   If I have:
   ```
   sql("create database db")
   sql("create table spark_catalog.db ...")
   sql("use spark_catalog.db") // Current namespace is "db"
   sql("drop database db") // Current namespace is still "db"
   ```
   Should we fix above? I can fix it as a separate PR if the current behavior doesn't seem right.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -84,7 +105,7 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
         false -> "PARTITION(YEAR = 2015, Month = 1)"
       ).foreach { case (caseSensitive, partitionSpec) =>
         withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) {
-          val df = sql(s"SHOW TABLE EXTENDED LIKE 'part_table' $partitionSpec")
+          val df = sql(s"SHOW TABLE EXTENDED IN ns LIKE 'part_table' $partitionSpec")

Review comment:
       This seems like an existing bug, but this worked because the current namespace was never reset even when the namespace is dropped.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       V1 / V2 behaviors are the same since the current namespace is managed by `CatalogManager`. (`SessionCatalog` doesn't reset the current database when the current database is dropped). Let me check the postgre's behavior.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       V1 / V2 behaviors are the same since the current namespace is managed by `CatalogManager`. (`SessionCatalog.dropDatabase` also doesn't reset the current database when the current database is dropped). Let me check the postgre's behavior.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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






-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala
##########
@@ -53,7 +53,7 @@ class V2SessionCatalog(catalog: SessionCatalog)
       case Array(db) =>
         catalog
           .listTables(db)
-          .map(ident => Identifier.of(Array(ident.database.getOrElse("")), ident.table))
+          .map(ident => Identifier.of(ident.database.map(Array(_)).getOrElse(Array()), ident.table))

Review comment:
       Without this change, the namespace will be displayed as ` `` ` instead of empty string.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143830 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143830/testReport)** for PR 34137 at commit [`0c968ff`](https://github.com/apache/spark/commit/0c968ff5f14dfa60945bf7c6210b6369f7bbeff3).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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






-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


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


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       V1 / V2 behaviors are the same since the current namespace is managed by `CatalogManager`. (`SessionCatalog.dropDatabase` also doesn't reset the current database when the current database is dropped). Let me check the postgre's behavior.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala
##########
@@ -40,6 +42,10 @@ trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils {
     checkAnswer(df, expected)
   }
 
+  after {
+    spark.sessionState.catalogManager.reset()

Review comment:
       I think this problem is inevitable. It's possible that another user drops the database you are using currently via another session, and there is no way to forbid it.
   
   It seems more of a test problem: the test should reset any stats it set during testing, including the current database.




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143705 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143705/testReport)** for PR 34137 at commit [`d301cab`](https://github.com/apache/spark/commit/d301cab8f52493a79f81d8108909d7b2ac580e86).


-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##########
@@ -143,6 +163,8 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase {
  * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog.
  */
 class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase {
+  override def version: String = super[ShowTablesSuiteBase].version

Review comment:
       is this line needed?




-- 
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 #34137: [SPARK-36588] Migrate SHOW TABLES to use V2 command by default

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


   **[Test build #143705 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143705/testReport)** for PR 34137 at commit [`d301cab`](https://github.com/apache/spark/commit/d301cab8f52493a79f81d8108909d7b2ac580e86).


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