cloud-fan commented on code in PR #48883:
URL: https://github.com/apache/spark/pull/48883#discussion_r1863634717
##########
sql/api/src/main/scala/org/apache/spark/sql/types/VarcharType.scala:
##########
@@ -16,14 +16,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 VarcharType(length: Int) extends AtomicType {
+case class VarcharType(length: Int)
+ extends StringType(CollationFactory.UTF8_BINARY_COLLATION_ID,
MaxLength(length)) {
require(length >= 0, "The length of varchar type cannot be negative.")
override def defaultSize: Int = length
override def typeName: String = s"varchar($length)"
+ override def jsonValue: JValue = JString(typeName)
Review Comment:
ditto
--
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]