You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2018/11/05 20:58:10 UTC
[GitHub] spark issue #21596: [SPARK-24601] Update Jackson to 2.9.6
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/21596
It sounds like Jackson have an important behavior change that might impact us.
```Scala
import com.fasterxml.jackson.annotation.JsonInclude.Include
import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
val mapper = new ObjectMapper with ScalaObjectMapper
mapper.setSerializationInclusion(Include.NON_NULL)
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
mapper.registerModule(DefaultScalaModule)
println(mapper.writeValueAsString(Map("abc" -> null)))
```
Previously, it outputs `{"abc":null}`, but now it is `{}`, unless we explicitly set it to `Include.ALWAYS`. The upgrade looks risky to me.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org