You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/04/03 16:18:00 UTC

[jira] [Commented] (KAFKA-6684) Support casting values with bytes schema to string

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

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

amitsela opened a new pull request #4820: KAFKA-6684 [WIP]: Cast transform bytes
URL: https://github.com/apache/kafka/pull/4820
 
 
   Allow to cast LogicalType to string by calling the serialized (Java) object's toString().   
   
   Added tests for `BigDecimal` and `Date` as whole record and as fields. 
   
   ### 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Support casting values with bytes schema to string 
> ---------------------------------------------------
>
>                 Key: KAFKA-6684
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6684
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect
>            Reporter: Amit Sela
>            Priority: Major
>
> Casting from BYTES is not supported, which means that casting LogicalTypes is not supported.
> This proposes to allow casting anything to a string, kind of like Java's {{toString()}}, such that if the object is actually a LogicalType it can be "serialized" as string instead of bytes+schema.
>  
> {noformat}
> Examples:
> BigDecimal will cast to the string representation of the number.
> Timestamp will cast to the string representation of the timestamp, or maybe UTC yyyymmddTHH:MM:SS.f format?
> {noformat}
>  
> Worst case, bytes are "casted" to whatever the {{toString()}} returns - its up to the user to know the data.
> This would help when using a JSON sink, or anything that's not Avro.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)