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/09/19 20:54:30 UTC

[GitHub] [spark] imback82 opened a new pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   <!--
   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.
   -->
   This PR fixes the `Relation: view text` test in `DataSourceV2SQLSuite`.
   
   ### 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.
   -->
   The existing code just defines a function literal and doesn't execute the it.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Existing 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.

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] dongjoon-hyun commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #29811:
URL: https://github.com/apache/spark/pull/29811#discussion_r492456132



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       @imback82 . This is orthogonal to `Fix an invalid test in DataSourceV2SQLSuite`. Could you make a PR for this one independently?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table
+        case t =>
+          val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
+          tables.put(ident, table)
+          table
+      }

Review comment:
       Now that the test runs, it actually fails because this block remove `V1Table` info, which is needed in the following:
   https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1008




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       Updated the PR description.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -758,8 +758,9 @@ class DataSourceV2SQLSuite
 
   test("Relation: view text") {
     val t1 = "testcat.ns1.ns2.tbl"
+    val v1 = "view1"
     withTable(t1) {
-      withView("view1") { v1: String =>

Review comment:
       This just defines an anonymous function, and `v1` is a function parameter.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128894 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128894/testReport)** for PR 29811 at commit [`3f08d03`](https://github.com/apache/spark/commit/3f08d037b242f0ee77d191f646c372394b13f884).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,7 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table

Review comment:
       Now that the test actually runs, it actually fails because this block remove `V1Table` info, which is needed in the following:
   https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1008
   
   I don't think we need to put the result of `loadTable` into `tables`, but if we need to cache it, I can change this to something like:
   ```scala
   super.loadTable(ident) match {
     case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table // or 'case v1Table: V1Table => v1Table'
     case t =>
       val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
       tables.put(ident, table)
       table
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -758,8 +758,9 @@ class DataSourceV2SQLSuite
 
   test("Relation: view text") {
     val t1 = "testcat.ns1.ns2.tbl"
+    val v1 = "view1"
     withTable(t1) {
-      withView("view1") { v1: String =>

Review comment:
       what was the value of `v1` before?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,7 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table

Review comment:
       Now that the test actually runs, it actually fails because this block remove `V1Table` info, which is needed in the following:
   https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1008
   
   I don't think we need to put the result of `loadTable` into `tables`, but if we need to cache it, I can change this to something like:
   ```scala
   super.loadTable(ident) match {
     case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table // or 'case v1Table: V1Table => v1Table'
     case t =>
       val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
       tables.put(ident, table)
       table
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #29811:
URL: https://github.com/apache/spark/pull/29811#discussion_r492456132



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       @imback82 . This is orthogonal to `Fix an invalid test in DataSourceV2SQLSuite`. Could you make a PR for this one independently?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       or we should at least mention it in the PR description, to explain why it's needed to fix the 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.

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 #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       Updated the PR description.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan closed pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128893 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128893/testReport)** for PR 29811 at commit [`9105cba`](https://github.com/apache/spark/commit/9105cba86385f7c0daafda6199bd934015ef063a).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   cc @cloud-fan 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   @dongjoon-hyun, I updated the PR title with JIRA id. Does the fixed test need to have it as well - e.g., `test("SPARK-32959: Relation: view text")`?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   good catch! 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.

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 #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128893 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128893/testReport)** for PR 29811 at commit [`9105cba`](https://github.com/apache/spark/commit/9105cba86385f7c0daafda6199bd934015ef063a).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -758,8 +758,9 @@ class DataSourceV2SQLSuite
 
   test("Relation: view text") {
     val t1 = "testcat.ns1.ns2.tbl"
+    val v1 = "view1"
     withTable(t1) {
-      withView("view1") { v1: String =>

Review comment:
       This just defines an anonymous function, and `v1` is a function parameter.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -758,8 +758,9 @@ class DataSourceV2SQLSuite
 
   test("Relation: view text") {
     val t1 = "testcat.ns1.ns2.tbl"
+    val v1 = "view1"
     withTable(t1) {
-      withView("view1") { v1: String =>

Review comment:
       what was the value of `v1` before?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table

Review comment:
       or we should at least mention it in the PR description, to explain why it's needed to fix the 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.

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 #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128894 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128894/testReport)** for PR 29811 at commit [`3f08d03`](https://github.com/apache/spark/commit/3f08d037b242f0ee77d191f646c372394b13f884).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29811:
URL: https://github.com/apache/spark/pull/29811#issuecomment-695399616


   In this case, could you use JIRA id please, @imback82 ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] imback82 commented on a change in pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table
+        case t =>
+          val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
+          tables.put(ident, table)
+          table
+      }

Review comment:
       Now that the test actually runs, it actually fails because this block remove `V1Table` info, which is needed in the following:
   https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1008




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128893 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128893/testReport)** for PR 29811 at commit [`9105cba`](https://github.com/apache/spark/commit/9105cba86385f7c0daafda6199bd934015ef063a).
    * 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.

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 #29811: [MINOR][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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


   **[Test build #128894 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128894/testReport)** for PR 29811 at commit [`3f08d03`](https://github.com/apache/spark/commit/3f08d037b242f0ee77d191f646c372394b13f884).
    * 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



---------------------------------------------------------------------
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 #29811: [SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -47,10 +47,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating
       tables.get(ident)
     } else {
       // Table was created through the built-in catalog
-      val t = super.loadTable(ident)
-      val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
-      tables.put(ident, table)
-      table
+      super.loadTable(ident) match {
+        case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table
+        case t =>
+          val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties())
+          tables.put(ident, table)
+          table
+      }

Review comment:
       Now that the test runs, it actually fails because this block remove `V1Table` info, which is needed in the following:
   https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1008




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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