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 2020/03/24 22:52:11 UTC

[GitHub] [spark] imback82 opened a new pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

imback82 opened a new pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004
 
 
   <!--
   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'.
   -->
   
   ### 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.
   -->
   `HiveResult` performs some conversions for commands to be compatible with Hive output, e.g.:
   ```
   // If it is a describe command for a Hive table, we want to have the output format be similar with Hive.
   case ExecutedCommandExec(_: DescribeCommandBase) =>
   ...
   // SHOW TABLES in Hive only output table names, while ours output database, table name, isTemp.
   case command @ ExecutedCommandExec(s: ShowTablesCommand) if !s.isExtended =>
   ```
   This conversion is needed for DatasourceV2 commands as well and this PR proposes to add the conversion for v2 commands `SHOW TABLES` and `DESCRIBE TABLE`.
   
   ### 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.
   -->
   This is a bug where conversion is not applied to v2 commands.
   
   ### Does this PR introduce any user-facing change?
   <!--
   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 no, write 'No'.
   -->
   Yes, now the outputs for v2 commands `SHOW TABLES` and `DESCRIBE TABLE` are compatible with HIVE output.
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603547808
 
 
   **[Test build #120289 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120289/testReport)** for PR 28004 at commit [`ea4e389`](https://github.com/apache/spark/commit/ea4e389e0d534020393109f39971cba238040520).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604813272
 
 
   thanks, merging to master/3.0!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604497385
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25137/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604349678
 
 
   LGTM, can we fix the conflicts?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604664557
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#discussion_r398464578
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
 ##########
 @@ -68,4 +69,35 @@ class HiveResultSuite extends SharedSparkSession {
     val result = HiveResult.hiveResultString(executedPlan)
     assert(result.head === "0.00000000")
   }
+
+  test("SHOW TABLES in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint) USING $source")
+            val df = spark.sql(s"SHOW TABLES FROM $ns")
+            val executedPlan = df.queryExecution.executedPlan
+            assert(HiveResult.hiveResultString(executedPlan).head == tbl)
+          }
+      }
+    }
+  }
+
+  test("DESCRIBE TABLE in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint COMMENT 'col1') USING $source")
+            val df = spark.sql(s"DESCRIBE $ns.$tbl")
+            val executedPlan = df.queryExecution.executedPlan
+            val expected = "id                  " +
+              "\tbigint              " +
+              "\tcol1                "
+            assert(HiveResult.hiveResultString(executedPlan).head == expected)
 
 Review comment:
   can we make the test more robust? e.g.
   ```
   assert(HiveResult.hiveResultString(executedPlan).head.split("\n").map(_.trim) == Seq("id", "bigint", "col1"))
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] HyukjinKwon commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603636775
 
 
   > Yes, now the outputs for v2 commands SHOW TABLES and DESCRIBE TABLE are compatible with HIVE output.
   
   Can you show before/after input/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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603616637
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/120289/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603548260
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24999/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604497385
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25137/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604664557
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603616631
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603548246
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#discussion_r399016671
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
 ##########
 @@ -68,4 +69,35 @@ class HiveResultSuite extends SharedSparkSession {
     val result = HiveResult.hiveResultString(executedPlan)
     assert(result.head === "0.00000000")
   }
+
+  test("SHOW TABLES in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint) USING $source")
+            val df = spark.sql(s"SHOW TABLES FROM $ns")
+            val executedPlan = df.queryExecution.executedPlan
+            assert(HiveResult.hiveResultString(executedPlan).head == tbl)
+          }
+      }
+    }
+  }
+
+  test("DESCRIBE TABLE in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint COMMENT 'col1') USING $source")
+            val df = spark.sql(s"DESCRIBE $ns.$tbl")
+            val executedPlan = df.queryExecution.executedPlan
+            val expected = "id                  " +
+              "\tbigint              " +
+              "\tcol1                "
+            assert(HiveResult.hiveResultString(executedPlan).head == expected)
 
 Review comment:
   ok so the number of spaces is also defined bu the Hive.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603548260
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24999/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603547808
 
 
   **[Test build #120289 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120289/testReport)** for PR 28004 at commit [`ea4e389`](https://github.com/apache/spark/commit/ea4e389e0d534020393109f39971cba238040520).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604664564
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/120429/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603616063
 
 
   **[Test build #120289 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120289/testReport)** for PR 28004 at commit [`ea4e389`](https://github.com/apache/spark/commit/ea4e389e0d534020393109f39971cba238040520).
    * 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604496402
 
 
   **[Test build #120429 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120429/testReport)** for PR 28004 at commit [`5de8684`](https://github.com/apache/spark/commit/5de8684b5f38be01f5978247c9f81529100ee096).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#discussion_r399016671
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
 ##########
 @@ -68,4 +69,35 @@ class HiveResultSuite extends SharedSparkSession {
     val result = HiveResult.hiveResultString(executedPlan)
     assert(result.head === "0.00000000")
   }
+
+  test("SHOW TABLES in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint) USING $source")
+            val df = spark.sql(s"SHOW TABLES FROM $ns")
+            val executedPlan = df.queryExecution.executedPlan
+            assert(HiveResult.hiveResultString(executedPlan).head == tbl)
+          }
+      }
+    }
+  }
+
+  test("DESCRIBE TABLE in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint COMMENT 'col1') USING $source")
+            val df = spark.sql(s"DESCRIBE $ns.$tbl")
+            val executedPlan = df.queryExecution.executedPlan
+            val expected = "id                  " +
+              "\tbigint              " +
+              "\tcol1                "
+            assert(HiveResult.hiveResultString(executedPlan).head == expected)
 
 Review comment:
   ok so the number of spaces is also defined by Hive.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] imback82 commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
imback82 commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603623532
 
 
   cc @cloud-fan @juliuszsompolski 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603616637
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/120289/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
imback82 commented on a change in pull request #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#discussion_r398656454
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
 ##########
 @@ -68,4 +69,35 @@ class HiveResultSuite extends SharedSparkSession {
     val result = HiveResult.hiveResultString(executedPlan)
     assert(result.head === "0.00000000")
   }
+
+  test("SHOW TABLES in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint) USING $source")
+            val df = spark.sql(s"SHOW TABLES FROM $ns")
+            val executedPlan = df.queryExecution.executedPlan
+            assert(HiveResult.hiveResultString(executedPlan).head == tbl)
+          }
+      }
+    }
+  }
+
+  test("DESCRIBE TABLE in hive result") {
+    withSQLConf("spark.sql.catalog.testcat" -> classOf[InMemoryTableCatalog].getName) {
+      Seq(("testcat.ns", "tbl", "foo"), ("spark_catalog.default", "tbl", "csv")).foreach {
+        case (ns, tbl, source) =>
+          withTable(s"$ns.$tbl") {
+            spark.sql(s"CREATE TABLE $ns.$tbl (id bigint COMMENT 'col1') USING $source")
+            val df = spark.sql(s"DESCRIBE $ns.$tbl")
+            val executedPlan = df.queryExecution.executedPlan
+            val expected = "id                  " +
+              "\tbigint              " +
+              "\tcol1                "
+            assert(HiveResult.hiveResultString(executedPlan).head == expected)
 
 Review comment:
   If you `trim`, wouldn't it make the test less robust? Adding the padding was the compatibility change for `DESCRIBE`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603616631
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604663590
 
 
   **[Test build #120429 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120429/testReport)** for PR 28004 at commit [`5de8684`](https://github.com/apache/spark/commit/5de8684b5f38be01f5978247c9f81529100ee096).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `final class VarianceThresholdSelector @Since(\"3.1.0\")(@Since(\"3.1.0\") override val uid: String)`
     * `    // `case class Foo(i: Int) extends AnyVal` will return type `Int` instead of `Foo`.`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604664564
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/120429/
   Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] imback82 commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
imback82 commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603994048
 
 
   > Can you show before/after input/output?
   
   I updated the description. Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604497371
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-603548246
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604497371
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28004: [SPARK-31204][SQL] HiveResult compatibility for DatasourceV2 command
URL: https://github.com/apache/spark/pull/28004#issuecomment-604496402
 
 
   **[Test build #120429 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/120429/testReport)** for PR 28004 at commit [`5de8684`](https://github.com/apache/spark/commit/5de8684b5f38be01f5978247c9f81529100ee096).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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