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/23 15:07:37 UTC

[GitHub] [spark] ScrapCodes opened a new pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

ScrapCodes opened a new pull request #30142:
URL: https://github.com/apache/spark/pull/30142


   <!--
   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.
   -->
   Support rename column for mysql dialect.
   
   ### 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.
   -->
   At the moment, it does not work for mysql version 5.x. So, we should throw proper exception for that case.
   
   ### 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'.
   -->
   Yes, `column rename` with mysql dialect should work correctly.
   
   ### 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 tests for rename column.


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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] ScrapCodes commented on a change in pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/V2JDBCTest.scala
##########
@@ -46,6 +46,20 @@ trait V2JDBCTest extends SharedSparkSession {
     assert(msg.contains("Cannot update missing field bad_column"))
   }
 
+  def testRenameColumn(tbl: String): Unit = {
+    sql(s"CREATE TABLE $tbl (ID STRING NOT NULL, ID1 STRING NOT NULL) USING _")
+    sql(s"ALTER TABLE $tbl RENAME COLUMN ID TO ID2")
+    val t = spark.table(s"$tbl")
+    val expectedSchema = new StructType().add("ID2", StringType, nullable = true)
+      .add("ID1", StringType, nullable = true)
+    assert(t.schema === expectedSchema)
+    // Rename to already existing column

Review comment:
       done




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/35012/
   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] SparkQA commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130205 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130205/testReport)** for PR 30142 at commit [`73b0550`](https://github.com/apache/spark/commit/73b055051de463be8cd933f524438eec4b1ac78b).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/34807/
   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] SparkQA commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130402 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130402/testReport)** for PR 30142 at commit [`2e4fd62`](https://github.com/apache/spark/commit/2e4fd623f46941d7d2c34bef98d8af20c57360d3).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130205 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130205/testReport)** for PR 30142 at commit [`73b0550`](https://github.com/apache/spark/commit/73b055051de463be8cd933f524438eec4b1ac78b).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130408 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130408/testReport)** for PR 30142 at commit [`fe1e44f`](https://github.com/apache/spark/commit/fe1e44f86c84800876b8929760a8f7acba2a430f).
    * 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] huaxingao commented on a change in pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala
##########
@@ -57,6 +58,25 @@ private case object MySQLDialect extends JdbcDialect {
     s"ALTER TABLE $tableName MODIFY COLUMN ${quoteIdentifier(columnName)} $newDataType"
   }
 
+  // See Old Syntax: https://dev.mysql.com/doc/refman/5.6/en/alter-table.html
+  // According to https://dev.mysql.com/worklog/task/?id=10761 old syntax works for
+  // both versions of MySQL i.e. 5.x and 8.0
+  // The old syntax requires us to have type definition. Since we do not have type
+  // information, we throw the exception.
+  override def getRenameColumnQuery(
+      tableName: String,
+      columnName: String,
+      newName: String): String = {
+    if (SQLConf.get.jdbcMySQLVersion.matches("^8\\.[0-9].*")) {

Review comment:
       Instead of using a session config, we probably want to get database version using `DatabaseMetaData` in `JdbcUtils.altertable` and pass the info here, and only do `RENAME` if version >= 8
   ```
   conn.getMetaData.getDatabaseMajorVersion
   ```




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130206 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130206/testReport)** for PR 30142 at commit [`7c9aa72`](https://github.com/apache/spark/commit/7c9aa72e3b3656723bbb8f811b780d5e4b35dc4c).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130407 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130407/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
##########
@@ -77,11 +86,26 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite with V2JDBCTest {
     assert(msg1.contains("Cannot update alt_table field ID: string cannot be cast to int"))
   }
 
+  override def testRenameColumn(tbl: String): Unit = {
+    if (db.imageName.matches(".*mysql.5\\.[0-9].*")) {

Review comment:
       we can check the config value here.




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

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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala
##########
@@ -57,6 +58,25 @@ private case object MySQLDialect extends JdbcDialect {
     s"ALTER TABLE $tableName MODIFY COLUMN ${quoteIdentifier(columnName)} $newDataType"
   }
 
+  // See Old Syntax: https://dev.mysql.com/doc/refman/5.6/en/alter-table.html
+  // According to https://dev.mysql.com/worklog/task/?id=10761 old syntax works for
+  // both versions of MySQL i.e. 5.x and 8.0
+  // The old syntax requires us to have type definition. Since we do not have type
+  // information, we throw the exception.
+  override def getRenameColumnQuery(
+      tableName: String,
+      columnName: String,
+      newName: String): String = {
+    if (SQLConf.get.jdbcMySQLVersion.matches("^8\\.[0-9].*")) {

Review comment:
       ah, it's even better if we can get the database version, so that users don't need to specify it.




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

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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130402 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130402/testReport)** for PR 30142 at commit [`2e4fd62`](https://github.com/apache/spark/commit/2e4fd623f46941d7d2c34bef98d8af20c57360d3).
    * 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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130408 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130408/testReport)** for PR 30142 at commit [`fe1e44f`](https://github.com/apache/spark/commit/fe1e44f86c84800876b8929760a8f7acba2a430f).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/130402/
   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] SparkQA commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130404 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130404/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130402 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130402/testReport)** for PR 30142 at commit [`2e4fd62`](https://github.com/apache/spark/commit/2e4fd623f46941d7d2c34bef98d8af20c57360d3).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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] ScrapCodes commented on a change in pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala
##########
@@ -57,6 +58,25 @@ private case object MySQLDialect extends JdbcDialect {
     s"ALTER TABLE $tableName MODIFY COLUMN ${quoteIdentifier(columnName)} $newDataType"
   }
 
+  // See Old Syntax: https://dev.mysql.com/doc/refman/5.6/en/alter-table.html
+  // According to https://dev.mysql.com/worklog/task/?id=10761 old syntax works for
+  // both versions of MySQL i.e. 5.x and 8.0
+  // The old syntax requires us to have type definition. Since we do not have type
+  // information, we throw the exception.
+  override def getRenameColumnQuery(
+      tableName: String,
+      columnName: String,
+      newName: String): String = {
+    if (SQLConf.get.jdbcMySQLVersion.matches("^8\\.[0-9].*")) {

Review comment:
       Thank you @huaxingao and @cloud-fan, for this suggestion. 




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

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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/V2JDBCTest.scala
##########
@@ -46,6 +46,20 @@ trait V2JDBCTest extends SharedSparkSession {
     assert(msg.contains("Cannot update missing field bad_column"))
   }
 
+  def testRenameColumn(tbl: String): Unit = {
+    sql(s"CREATE TABLE $tbl (ID STRING NOT NULL, ID1 STRING NOT NULL) USING _")
+    sql(s"ALTER TABLE $tbl RENAME COLUMN ID TO ID2")
+    val t = spark.table(s"$tbl")
+    val expectedSchema = new StructType().add("ID2", StringType, nullable = true)
+      .add("ID1", StringType, nullable = true)
+    assert(t.schema === expectedSchema)
+    // Rename to already existing column

Review comment:
       This can be put in the `test("SPARK-33034: ALTER TABLE ... rename column")`, as the behavior should always be the same.




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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] huaxingao commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   @ScrapCodes seems you forgot to address this https://github.com/apache/spark/pull/30142#discussion_r514212732. Everything else is good.


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130205 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130205/testReport)** for PR 30142 at commit [`73b0550`](https://github.com/apache/spark/commit/73b055051de463be8cd933f524438eec4b1ac78b).
    * 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 commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -2858,6 +2858,14 @@ object SQLConf {
     .stringConf
     .createWithDefault("")
 
+  val JDBC_MYSQL_VERSION =
+    buildConf("spark.sql.jdbc.mysql.version")

Review comment:
       what if users want to connect to both mysql 5 and 8? I think it's better to make it a catalog option, not a session config.




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130207 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130207/testReport)** for PR 30142 at commit [`f4b8a24`](https://github.com/apache/spark/commit/f4b8a24d061ab8fadf4e2e0006b904a035c3516e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130206 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130206/testReport)** for PR 30142 at commit [`7c9aa72`](https://github.com/apache/spark/commit/7c9aa72e3b3656723bbb8f811b780d5e4b35dc4c).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130207 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130207/testReport)** for PR 30142 at commit [`f4b8a24`](https://github.com/apache/spark/commit/f4b8a24d061ab8fadf4e2e0006b904a035c3516e).
    * 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] cloud-fan commented on a change in pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
##########
@@ -50,16 +50,23 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite with V2JDBCTest {
     override val jdbcPort: Int = 3306
 
     override def getJdbcUrl(ip: String, port: Int): String =
-      s"jdbc:mysql://$ip:$port/mysql?user=root&password=rootpass"
+      s"jdbc:mysql://$ip:$port/" +
+        s"mysql?user=root&password=rootpass&allowPublicKeyRetrieval=true&useSSL=false"
   }
 
-  override def sparkConf: SparkConf = super.sparkConf
-    .set("spark.sql.catalog.mysql", classOf[JDBCTableCatalog].getName)
-    .set("spark.sql.catalog.mysql.url", db.getJdbcUrl(dockerIp, externalPort))
+  override def sparkConf: SparkConf = {

Review comment:
       unnecessary change




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   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] ScrapCodes commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   Jenkins, retest this please


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

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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
##########
@@ -77,11 +84,25 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite with V2JDBCTest {
     assert(msg1.contains("Cannot update alt_table field ID: string cannot be cast to int"))
   }
 
+  override def testRenameColumn(tbl: String): Unit = {
+    assert( mySQLVersion > 0)

Review comment:
       nit: `assert(mySQLVersion > 0)` (remove extra space)




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130407 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130407/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130404 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130404/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).
    * 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] SparkQA commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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] ScrapCodes commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   @cloud-fan and @huaxingao I have updated the PR with your suggestions and also rebased it with master. Please take a look again.


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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



##########
File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
##########
@@ -77,11 +86,26 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite with V2JDBCTest {
     assert(msg1.contains("Cannot update alt_table field ID: string cannot be cast to int"))
   }
 
+  override def testRenameColumn(tbl: String): Unit = {
+    if (db.imageName.matches(".*mysql.5\\.[0-9].*")) {
+      sql(s"CREATE TABLE $tbl (ID STRING NOT NULL) USING _")
+      // Update nullability is unsupported for mysql db.

Review comment:
       rename is unsupported ...




----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   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] AmplabJenkins commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130408 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130408/testReport)** for PR 30142 at commit [`fe1e44f`](https://github.com/apache/spark/commit/fe1e44f86c84800876b8929760a8f7acba2a430f).


----------------------------------------------------------------
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] ScrapCodes commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   While testing #30038, I found rename column needs some work for mysql dialect. More details added in the code comments.
   
   cc @cloud-fan and @huaxingao


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130206 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130206/testReport)** for PR 30142 at commit [`7c9aa72`](https://github.com/apache/spark/commit/7c9aa72e3b3656723bbb8f811b780d5e4b35dc4c).
    * 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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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






----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130407 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130407/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).
    * 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] SparkQA commented on pull request #30142: [SPARK-33095] Follow up, support alter table column rename.

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


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


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130404 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130404/testReport)** for PR 30142 at commit [`9e1f75a`](https://github.com/apache/spark/commit/9e1f75a035c0e2d6f65fd6ac4be1668b128ff93e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130207 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130207/testReport)** for PR 30142 at commit [`f4b8a24`](https://github.com/apache/spark/commit/f4b8a24d061ab8fadf4e2e0006b904a035c3516e).


----------------------------------------------------------------
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 #30142: [SPARK-33095] Follow up, support alter table column rename.

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


   **[Test build #130452 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130452/testReport)** for PR 30142 at commit [`ce70996`](https://github.com/apache/spark/commit/ce70996154c8cea80267928f9d38a48be8f03c4b).


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