[ https://issues.apache.org/jira/browse/KAFKA-8595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16931926#comment-16931926 ]
ASF GitHub Bot commented on KAFKA-8595: --------------------------------------- agavra commented on pull request #7354: KAFKA-8595: Support deserialization of decimals encoded in NUMERIC fo… URL: https://github.com/apache/kafka/pull/7354 see [KIP-481](https://cwiki.apache.org/confluence/display/KAFKA/KIP-481%3A+SerDe+Improvements+for+Connect+Decimal+type+in+JSON) for more details Review Guide: - Added `DecimalFormat` enum to represent different JSON decimal node types and corresponding config in `JsonConverterConfig` - Split `LogicalTypeConverter` to have two strongly typed methods (`toJson` and `toConnect`) so that we could group SerDe methods together (this caused some code to move around because I could combine `TO_JSON_LOGICAL_CONVERTERS` and `TO_CONNECT_LOGICAL_CONVERTERS`) - Implemented the SerDe in the line containing `LOGICAL_CONVERTERS.put(Decimal.LOGICAL_NAME, new LogicalTypeConverter()` - Added `CaseInsensitiveValidString` to the validators Unit tests covering all of the formats are added. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Support SerDe of Decimals in JSON that are not HEX encoded > ---------------------------------------------------------- > > Key: KAFKA-8595 > URL: https://issues.apache.org/jira/browse/KAFKA-8595 > Project: Kafka > Issue Type: Improvement > Reporter: Almog Gavra > Assignee: Almog Gavra > Priority: Major > > Most JSON data that utilizes precise decimal data represents it as a decimal > string. Kafka Connect, on the other hand, only supports a binary HEX string > encoding (see example below). We should support deserialization and > serialization for any of the following types: > {code:java} > { > "asHex": "D3J5", > "asString": "10.12345" > "asNumber": 10.2345 > }{code} -- This message was sent by Atlassian Jira (v8.3.4#803005)