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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to