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/10/05 09:49:56 UTC

[GitHub] [spark] MaxGekk opened a new pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

MaxGekk opened a new pull request #29945:
URL: https://github.com/apache/spark/pull/29945


   ### What changes were proposed in this pull request?
   Add checks for the cases when JDBC v2 Table Catalog commands fail.
   
   ### Why are the changes needed?
   To improve test coverage.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   By running `JDBCTableCatalogSuite`.


----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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






----------------------------------------------------------------
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] HyukjinKwon commented on pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


   Merged 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] maropu commented on a change in pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
##########
@@ -121,16 +163,38 @@ class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession {
       t = spark.table("h2.test.alt_table")
       expectedSchema = expectedSchema.add("C3", DoubleType)
       assert(t.schema === expectedSchema)
+      // Add already existing column
+      intercept[AnalysisException] {
+        sql(s"ALTER TABLE h2.test.alt_table ADD COLUMNS (C3 DOUBLE)")

Review comment:
       ditto

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
##########
@@ -87,6 +95,26 @@ class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession {
         sql("SHOW TABLES IN h2.test"),
         Seq(Row("test", "dst_table"), Row("test", "people")))
     }
+    // Rename not existing table or namespace
+    Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table =>
+      intercept[org.h2.jdbc.JdbcSQLException] {
+        sql(s"ALTER TABLE $table RENAME TO test.dst_table")
+      }
+    }
+    // Rename to an existing table
+    withTable("h2.test.dst_table") {
+      withConnection { conn =>
+        conn.prepareStatement("""CREATE TABLE "test"."dst_table" (id INTEGER)""").executeUpdate()
+      }
+      withTable("h2.test.src_table") {
+        withConnection { conn =>
+          conn.prepareStatement("""CREATE TABLE "test"."src_table" (id INTEGER)""").executeUpdate()
+        }
+        intercept[org.h2.jdbc.JdbcSQLException] {
+          sql(s"ALTER TABLE h2.test.src_table RENAME TO h2.test.dst_table")

Review comment:
       nit: remove `s`




----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


   **[Test build #129409 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129409/testReport)** for PR 29945 at commit [`7709551`](https://github.com/apache/spark/commit/77095516d7b17c1bd28895822beeeda9f45ad297).
    * 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] AmplabJenkins removed a comment on pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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






----------------------------------------------------------------
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] MaxGekk commented on pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


   @huaxingao @maropu Please, review this PR.


----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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






----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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






----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


   **[Test build #129409 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129409/testReport)** for PR 29945 at commit [`7709551`](https://github.com/apache/spark/commit/77095516d7b17c1bd28895822beeeda9f45ad297).


----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


   **[Test build #129409 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129409/testReport)** for PR 29945 at commit [`7709551`](https://github.com/apache/spark/commit/77095516d7b17c1bd28895822beeeda9f45ad297).


----------------------------------------------------------------
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] HyukjinKwon commented on a change in pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
##########
@@ -87,6 +95,26 @@ class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession {
         sql("SHOW TABLES IN h2.test"),
         Seq(Row("test", "dst_table"), Row("test", "people")))
     }
+    // Rename not existing table or namespace
+    Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table =>
+      intercept[org.h2.jdbc.JdbcSQLException] {
+        sql(s"ALTER TABLE $table RENAME TO test.dst_table")
+      }
+    }
+    // Rename to an existing table
+    withTable("h2.test.dst_table") {
+      withConnection { conn =>
+        conn.prepareStatement("""CREATE TABLE "test"."dst_table" (id INTEGER)""").executeUpdate()
+      }
+      withTable("h2.test.src_table") {
+        withConnection { conn =>
+          conn.prepareStatement("""CREATE TABLE "test"."src_table" (id INTEGER)""").executeUpdate()
+        }
+        intercept[org.h2.jdbc.JdbcSQLException] {
+          sql(s"ALTER TABLE h2.test.src_table RENAME TO h2.test.dst_table")

Review comment:
       ```suggestion
             sql("ALTER TABLE h2.test.src_table RENAME TO h2.test.dst_table")
   ```

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
##########
@@ -121,16 +163,38 @@ class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession {
       t = spark.table("h2.test.alt_table")
       expectedSchema = expectedSchema.add("C3", DoubleType)
       assert(t.schema === expectedSchema)
+      // Add already existing column
+      intercept[AnalysisException] {
+        sql(s"ALTER TABLE h2.test.alt_table ADD COLUMNS (C3 DOUBLE)")

Review comment:
       ```suggestion
           sql("ALTER TABLE h2.test.alt_table ADD COLUMNS (C3 DOUBLE)")
   ```




----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


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


----------------------------------------------------------------
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] HyukjinKwon closed pull request #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #29945:
URL: https://github.com/apache/spark/pull/29945


   


----------------------------------------------------------------
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 #29945: [SPARK-33067][SQL][TESTS] Add negative checks to JDBC v2 Table Catalog tests

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


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


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