LuciferYang commented on code in PR #41559:
URL: https://github.com/apache/spark/pull/41559#discussion_r1227589806


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/types/DataTypeUtils.scala:
##########
@@ -16,14 +16,36 @@
  */
 package org.apache.spark.sql.catalyst.types
 
+import com.fasterxml.jackson.databind.annotation.{JsonDeserialize, 
JsonSerialize}
+import org.json4s._
+import org.json4s.JsonAST.JValue
+import org.json4s.JsonDSL._
+
 import org.apache.spark.sql.catalyst.analysis.Resolver
-import org.apache.spark.sql.catalyst.expressions.Cast
+import org.apache.spark.sql.catalyst.expressions.{Cast, Expression}
+import 
org.apache.spark.sql.catalyst.util.DataTypeJsonUtils.{DataTypeJsonDeserializer, 
DataTypeJsonSerializer}
 import org.apache.spark.sql.internal.SQLConf
 import org.apache.spark.sql.internal.SQLConf.StoreAssignmentPolicy
 import org.apache.spark.sql.internal.SQLConf.StoreAssignmentPolicy.{ANSI, 
STRICT}
 import org.apache.spark.sql.types.{ArrayType, AtomicType, DataType, MapType, 
NullType, StructType}
 
+@JsonSerialize(using = classOf[DataTypeJsonSerializer])
+@JsonDeserialize(using = classOf[DataTypeJsonDeserializer])

Review Comment:
   I suggest moving these two annotations back to DataType and we can change 
the following 
   
   
https://github.com/apache/spark/blob/daee47a436473b865343301a78fef715d2780c4d/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DataTypeJsonUtils.scala#L37
   
   to `delegate.serialize(DataTypeUtils.jsonValue(value.typeName), gen, 
provider)`



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