KAFKA-9083: Various fixes/improvements for Connect's Values class#7593
Merged
Conversation
Contributor
Author
|
@gharris1727 @kkonstantine would you mind taking a look when you have a chance? |
gharris1727
reviewed
Oct 25, 2019
gharris1727
left a comment
Contributor
There was a problem hiding this comment.
@C0urante These look like some really important fixes, and I'm always surprised when small issues like these stick around for so long. Thanks for handling these!
I just had a few questions about parsing control flow & restructuring.
gharris1727
approved these changes
Oct 26, 2019
gharris1727
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks @C0urante for humoring my boolean logic and control flow nits :)
rhauch
approved these changes
Jan 21, 2020
ijuma
added a commit
to confluentinc/kafka
that referenced
this pull request
Jan 23, 2020
* apache-github/trunk: KAFKA-9418; Add new sendOffsetsToTransaction API to KafkaProducer (apache#7952) KAFKA-7273 Clarification on mutability of headers passed to Converter#fromConnectData() (apache#7489) MINOR: Only update a request's local complete time in API handler if unset (apache#7813) KAFKA-9143: Log task reconfiguration error only when it happened (apache#7648) MINOR: Change the log level from ERROR to DEBUG when failing to get plugin loader for connector (apache#7964) KAFKA-9024: Better error message when field specified does not exist (apache#7819) KAFKA-7204: Avoid clearing records for paused partitions on poll of MockConsumer (apache#7505) KAFKA-9083: Various fixes/improvements for Connect's Values class (apache#7593) MINOR: log error message from Connect sink exception (apache#7555)
qq619618919
pushed a commit
to qq619618919/kafka
that referenced
this pull request
May 12, 2020
…ache#7593) Author: Chris Egerton <chrise@confluent.io> Reviewers: Greg Harris <gregh@confluent.io>, Randall Hauch <rhauch@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira
The following functional changes are implemented here:
• Top-level strings beginning with
"true","false"and then followed by token delimiters (e.g.,"true}"and"false]") are parsed as strings, not as booleans• The empty array (
"[]") is now parsed as an array with a null value schema• The empty map (
"{}") is now parsed as a map with null key and value schemas• Arrays with all-null elements are now parsed successfully (whereas before an NPE was thrown) as an array with a null value schema
• Maps with all-null values are now parsed as maps with null value schemas, but non-null key schemas
• Strings that appear to be arrays at first but are missing comma delimiters (e.g.,
"[0 1 2]") are now parsed as strings instead of arrays• A small improvement is made to the debug message generated when map parsing fails due to unexpected comma delimiters ("Unable to parse a map entry has no key or value" is changed to "Unable to parse a map entry with no key or value")
• A small improvement is made to the debug message generated when map parsing fails due to a missing
}("Map is missing terminating ']'" is changed to "Map is missing terminating '}'")• A small improvement is made to the debug message generated when array or map parsing fails and parsing is reset to process the input as a string ("Unable to parse the value as a map" is changed to "Unable to parse the value as a map or an array")
• Embedded values that lack surrounding quotes (e.g.,
fooin"[foo]") are no longer treated as strings; this is in line with the JSON-like representation that is meant to be supported by theValuesclass and prevents errors such as parsing"[0 1 2]"as an array containing a single string element with a value of"0 1 2"• The top-level string
"null"is now parsed asnullinstead of the string"null"; this does not break attempts to convert the top-level string"null"into a string (which should also be the string"null")Every change (except for log message alterations) is verified with one or more unit tests, and several unit tests are also added to prevent regression in functionality that, while not currently broken, is subtle enough that it may be missed in future changes without tests.
Committer Checklist (excluded from commit message)