leesf commented on a change in pull request #4586:
URL: https://github.com/apache/hudi/pull/4586#discussion_r785442620



##########
File path: 
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/streaming/HoodieSourceOffset.scala
##########
@@ -45,17 +45,21 @@ case class HoodieSourceOffset(commitTime: String) extends 
Offset {
 
 
 object HoodieSourceOffset {
-  val mapper = new ObjectMapper with ScalaObjectMapper
-  mapper.setSerializationInclusion(Include.NON_ABSENT)
-  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
-  mapper.registerModule(DefaultScalaModule)
+
+  lazy val mapper: ObjectMapper = {
+    val _mapper = new ObjectMapper
+    _mapper.setSerializationInclusion(Include.NON_ABSENT)
+    _mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
+    _mapper.registerModule(DefaultScalaModule)
+    _mapper
+  }
 
   def toJson(offset: HoodieSourceOffset): String = {
     mapper.writeValueAsString(offset)
   }
 
   def fromJson(json: String): HoodieSourceOffset = {
-    mapper.readValue[HoodieSourceOffset](json)
+    mapper.readValue(json, classOf[HoodieSourceOffset])

Review comment:
       is the change necessary?




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


Reply via email to