dejankrak-db commented on code in PR #50290:
URL: https://github.com/apache/spark/pull/50290#discussion_r1999191815


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala:
##########
@@ -424,6 +424,58 @@ trait DescribeTableSuiteBase extends 
command.DescribeTableSuiteBase
     }
   }
 
+  test("DESCRIBE AS JSON collation") {
+    withNamespaceAndTable("ns", "table") { t =>
+      val tableCreationStr =
+        s"""
+           |CREATE TABLE $t (
+           |  c1 STRING COLLATE UNICODE_CI,
+           |  c2 STRING COLLATE UNICODE_RTRIM,
+           |  c3 STRING COLLATE FR,
+           |  c4 STRING,
+           |  id INT
+           |)
+           |USING parquet COMMENT 'table_comment'

Review Comment:
   Once we add JSON support for table-level collation (top-level field), we 
should extend this test to also specify DEFAULT COLLATION for the table here



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/DescribeRelationJsonCommand.scala:
##########
@@ -223,6 +223,12 @@ case class DescribeRelationJsonCommand(
           "end_unit" -> JString(getFieldName(dayTimeIntervalType.endField))
         )
 
+      case stringType: StringType =>
+        JObject(
+          "name" -> JString("string"),
+          "collation" -> JString(stringType.collationName)

Review Comment:
   Is the plan to add a table collation as a top-level field to JSON in a 
separate PR?



-- 
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