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

Mark McDonald commented on KAFKA-17029:
---------------------------------------

Your feedback makes sense. I initially went for a very narrow fix for the 
immediate issue in [this 
PR|[https://github.com/apache/kafka/pull/16442/files].]  

My preference would be to implement the second solution you've proposed. The 
first solution makes sense but it's a bigger change and seems higher risk to 
me. If you're on board with the second approach, I would be interested in 
working on it. 

> SetSchemaMetadata smt throws DataException when avro schema is primitive type
> -----------------------------------------------------------------------------
>
>                 Key: KAFKA-17029
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17029
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Mark McDonald
>            Priority: Minor
>
> The SetSchemaMetadata smt can be used to set the schema name and version on 
> connect records. However, if the connect record is an Avro primitive type, 
> the smt thows a DataException. The reason for this is because there is a call 
> to the Schema [fields() 
> method|https://kafka.apache.org/20/javadoc/org/apache/kafka/connect/data/Schema.html#fields--].
>  This smt should be able to handle the case when the schema is not a struct. 
> [This is 
> where|https://github.com/apache/kafka/blob/42058462ac9ef65e0cad4240358bbb5db9cebcd4/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/SetSchemaMetadata.java#L90]
>  the DataException is encountered.
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to