[ 
https://issues.apache.org/jira/browse/KAFKA-9074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16956345#comment-16956345
 ] 

ASF GitHub Bot commented on KAFKA-9074:
---------------------------------------

rhauch commented on pull request #7568: KAFKA-9074: Correct Connect’s 
`Values.parseString` to properly parse a time and timestamp literal
URL: https://github.com/apache/kafka/pull/7568
 
 
   Time and timestamp literal strings contain a `:` character, but the internal 
parser used in the `Values.parseString(String)` method tokenizes on the colon 
character to tokenize and parse map entries. The colon could be escaped, but 
then the backslash character used to escape the colon is not removed and the 
parser fails to match the literal as a time or timestamp value.
   
   This fix corrects the parsing logic to properly parse timestamp and time 
literal strings whose colon characters are either escaped or unescaped. 
Additional unit tests were added to first verify the incorrect behavior and 
then to validate the correction.
   
   ### 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


> Connect's Values class does not parse time or timestamp values from string 
> literals
> -----------------------------------------------------------------------------------
>
>                 Key: KAFKA-9074
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9074
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>            Reporter: Randall Hauch
>            Assignee: Randall Hauch
>            Priority: Major
>
> The `Values.parseString(String)` method that returns a `SchemaAndValue` is 
> not able to parse a string that contains a time or timestamp literal into a 
> logical time or timestamp value. This is likely because the `:` is a 
> delimiter for the internal parser, and so literal values such as 
> `2019-08-23T14:34:54.346Z` and `14:34:54.346Z` are separated into multiple 
> tokens before matching the pattern.
> The colon can be escaped to prevent the unexpected tokenization, but then the 
> literal string contains the backslash character before each colon, and again 
> the pattern matching for the time and timestamp literal strings fails to 
> match.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to