cloud-fan commented on code in PR #48883:
URL: https://github.com/apache/spark/pull/48883#discussion_r1863633533


##########
sql/api/src/main/scala/org/apache/spark/sql/types/CharType.scala:
##########
@@ -17,14 +17,19 @@
 
 package org.apache.spark.sql.types
 
+import org.json4s.JsonAST.{JString, JValue}
+
 import org.apache.spark.annotation.Experimental
+import org.apache.spark.sql.catalyst.util.CollationFactory
 
 @Experimental
-case class CharType(length: Int) extends AtomicType {
+case class CharType(length: Int)
+    extends StringType(CollationFactory.UTF8_BINARY_COLLATION_ID, 
FixedLength(length)) {
   require(length >= 0, "The length of char type cannot be negative.")
 
   override def defaultSize: Int = length
   override def typeName: String = s"char($length)"
+  override def jsonValue: JValue = JString(typeName)

Review Comment:
   shouldn't the json value include the length?



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