C0urante commented on PR #10566:
URL: https://github.com/apache/kafka/pull/10566#issuecomment-1454040953

   Ah thanks @urbandan, that helps. It's worth noting that the latest example 
test case is probably missing calls to actually set the default value for the 
schema builder instances? (Things pass without those.)
   
   This has me thinking more and more about KAFKA-3910, which deals with the 
lack of support for recursive schemas in Connect. IMO this is a deficiency not 
in the API we provide, but in the implementation. And if we address that flaw, 
then we should probably be able to kill two birds with one stone--both the lack 
of support for recursive schemas, and the current issues with specifying a 
default value for struct schemas.
   
   I've prototyped a solution that seeks to address both, which can be found on 
a personal branch here: 
https://github.com/C0urante/kafka/commit/e4a595c5dc4ee5ab3185fb7603130dcc0773677d
   
   Not only does it pass with [every test case discussed here so 
far](https://github.com/C0urante/kafka/blob/e4a595c5dc4ee5ab3185fb7603130dcc0773677d/connect/api/src/test/java/org/apache/kafka/connect/data/SchemaBuilderTest.java#L41-L102),
 it also passes with a [rudimentary test case for recursive 
structs](https://github.com/C0urante/kafka/blob/e4a595c5dc4ee5ab3185fb7603130dcc0773677d/connect/api/src/test/java/org/apache/kafka/connect/data/SchemaBuilderTest.java#L126-L161),
 and for [more-involved combinations of comparisons between built and unbuilt 
schemas that come with default struct 
values](https://github.com/C0urante/kafka/blob/e4a595c5dc4ee5ab3185fb7603130dcc0773677d/connect/api/src/test/java/org/apache/kafka/connect/data/SchemaBuilderTest.java#L104-L123).
   
   There's at least one `TODO` item in it and we'd certainly want to add more 
test coverage, but I'm optimistic that this can satisfy everyone's use cases 
without requiring changes to the Connect API or breaking existing setups.
   
   What do you think?


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to