dejankrak-db commented on code in PR #51001: URL: https://github.com/apache/spark/pull/51001#discussion_r2106305666
########## sql/core/src/test/scala/org/apache/spark/sql/collation/DefaultCollationTestSuite.scala: ########## @@ -142,6 +155,22 @@ abstract class DefaultCollationTestSuite extends QueryTest with SharedSparkSessi } } + test("Alter table alter column type with default collation") { + // alter table alter column should inherit the table collation only if the column was not + // originally of a string type + withTable(testTable) { + sql(s"CREATE TABLE $testTable (c1 STRING, c2 STRING COLLATE UTF8_LCASE, c3 STRING)" + + s" DEFAULT COLLATION UTF8_LCASE") + sql(s"ALTER TABLE $testTable ALTER COLUMN c1 TYPE STRING") + sql(s"ALTER TABLE $testTable ALTER COLUMN c2 TYPE STRING") + sql(s"ALTER TABLE $testTable ALTER COLUMN c3 TYPE STRING COLLATE UNICODE") + + assertTableColumnCollation(testTable, "c1", "UTF8_BINARY") + assertTableColumnCollation(testTable, "c2", "UTF8_BINARY") Review Comment: I think c2 should remain UTF8_LCASE 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org