dbatomic commented on code in PR #45105:
URL: https://github.com/apache/spark/pull/45105#discussion_r1495053546


##########
sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala:
##########
@@ -174,4 +176,79 @@ class CollationSuite extends QueryTest with 
SharedSparkSession {
           Row(expected))
     }
   }
+
+  test("create table with collation") {
+    val tableName = "parquet_dummy_tbl"
+    val collationName = "UCS_BASIC_LCASE"
+    withTable(tableName) {
+      sql(
+        s"""
+           |CREATE TABLE $tableName (c1 STRING COLLATE '$collationName')
+           |USING PARQUET
+           |""".stripMargin)
+
+      sql(s"INSERT INTO $tableName VALUES ('aaa')")
+      sql(s"INSERT INTO $tableName VALUES ('AAA')")
+
+      checkAnswer(sql(s"SELECT DISTINCT collation(c1) FROM $tableName"), 
Seq(Row(collationName)))

Review Comment:
   Can you also add a checks that:
   1) COLLATION expression returns correct collation.
   2) schema for this column returns StringType(1) (same as we do in `collate 
returns proper type` test)



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

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