Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19773#discussion_r215280045
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala 
---
    @@ -1697,6 +1697,16 @@ abstract class DDLSuite extends QueryTest with 
SQLTestUtils {
         sql("ALTER TABLE dbx.tab1 CHANGE COLUMN col1 col1 INT COMMENT 'this is 
col1'")
         assert(getMetadata("col1").getString("key") == "value")
         assert(getMetadata("col1").getString("comment") == "this is col1")
    +
    +    // Ensure that changing column type takes effect
    +    sql("ALTER TABLE dbx.tab1 CHANGE COLUMN col1 col1 STRING")
    +    val column = 
catalog.getTableMetadata(tableIdent).schema.fields.find(_.name == "col1")
    +    assert(column.get.dataType == StringType)
    +
    +    // Ensure that changing partition column type throw exception
    +    intercept[AnalysisException] {
    +      sql("ALTER TABLE dbx.tab1 CHANGE COLUMN a a STRING")
    +    }
    --- End diff --
    
    Please compare the error message.


---

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

Reply via email to