KAFKA-10477: Fix JsonConverter regression to treat MISSING nodes as NULL nodes (#9306)
Fixes a regression introduced in `JsonConverter` with previous upgrades from Jackson Databind 2.9.x to 2.10.x. Jackson Databind version 2.10.0 included a backward-incompatible behavioral change to use `JsonNodeType.MISSING` (and `MissingNode`, the subclass of `JsonNode` that has a type of `MISSING`) instead of `JsonNodeType.NULL` / `NullNode`. See https://github.com/FasterXML/jackson-databind/issues/2211 for details of this change. This change makes recovers the older `JsonConverter` behavior of returning null on empty input. Added two unit tests for this change. Both unit tests were independently tested with earlier released versions and passed on all versions that used Jackson 2.9.x and earlier, and failed on all versions that used 2.10.x and that did not have the fixed included in the PR. Both of the new unit tests pass with this fix to `JsonConverter`. Author: Shaik Zakir Hussain <zhussain@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com>
显示
- connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverter.java 1 个添加, 1 个删除...ain/java/org/apache/kafka/connect/json/JsonConverter.java
- connect/json/src/test/java/org/apache/kafka/connect/json/JsonConverterTest.java 30 个添加, 0 个删除...java/org/apache/kafka/connect/json/JsonConverterTest.java
想要评论请 注册 或 登录