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

Ewen Cheslack-Postava commented on KAFKA-4068:
----------------------------------------------

Or we could override the Struct class's toString to be more useful? I think 
[~jcustenborder] has previously suggested doing something like this too since 
logging of structs doesn't provide any helpful debugging output at the moment. 
The choice of JSON also seems arbitrary -- why not csv? or some other 
text-based serialization format?

Part of the problem is that file connector potentially serves two purposes. I 
don't think anybody uses it in practice, but it serves both for user demo 
purposes and as an example for connector developers. The more we add to make 
things clearer for the user demo, the more we obfuscate the basic structure of 
a connector and make it harder to use as a template for other connectors.

> FileSinkTask - use JsonConverter to serialize
> ---------------------------------------------
>
>                 Key: KAFKA-4068
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4068
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect
>            Reporter: Shikhar Bhushan
>            Assignee: Shikhar Bhushan
>            Priority: Minor
>
> People new to Connect often try out hooking up e.g. a Kafka topic with Avro 
> data to the file sink connector, only to find the file contain values like:
> {noformat}
> org.apache.kafka.connect.data.Struct@ca1bf85a
> org.apache.kafka.connect.data.Struct@c298db6a
> org.apache.kafka.connect.data.Struct@44108fbd
> {noformat}
> This is because currently the {{FileSinkConnector}} is meant as a toy example 
> that expects the schema to be {{Schema.STRING_SCHEMA}}, though it just 
> {{toString()}}'s the value without verifying that. 
> A better experience would probably be if we used 
> {{JsonConverter.fromConnectData()}} for serializing to the file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to