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/02/12 10:14:39 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #27482: [SPARK-30613][SQL] Support Hive style REPLACE COLUMNS syntax

cloud-fan commented on a change in pull request #27482: [SPARK-30613][SQL] Support Hive style REPLACE COLUMNS syntax
URL: https://github.com/apache/spark/pull/27482#discussion_r378155598
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/connector/AlterTableTests.scala
 ##########
 @@ -1073,4 +1073,20 @@ trait AlterTableTests extends SharedSparkSession {
       assert(updated.properties === withDefaultOwnership(Map("provider" -> v2Format)).asJava)
     }
   }
+
+  test("AlterTable: replace columns") {
+    val t = s"${catalogAndNamespace}table_name"
+    withTable(t) {
+      sql(s"CREATE TABLE $t (col1 int, col2 int) USING $v2Format")
+      sql(s"ALTER TABLE $t REPLACE COLUMNS " +
+        "(col2 string COMMENT 'comment2', col3 int COMMENT 'comment3')")
 
 Review comment:
   One question: if the `col2` already has comment but we don't specify new comment in `REPLACE COLUMNS`, will we retain the comment?

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


With regards,
Apache Git Services

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