fanyang commented on PR #16035:
URL: https://github.com/apache/kafka/pull/16035#issuecomment-2132884096

   Hi Greg @gharris1727 ,
   Thank you for the comments. I'm interest in this item, and my current usage 
scenario is also related to avro schema and connect schema. For example, when 
we write kafka connect record into avro file, we set avro file schema to the 
schema of the first record, and following records need to be compatible with 
the avro file. 
   
   I have read the comments of other three jira tickets. I think I got your 
point. For example, the SchemaProjector need to have following behavior:
   ```
           // ConnectEnum is a logical type for enum defined in plugin
           Schema sourceSchema = ConnectEnum.builder("Card", 
Arrays.asList("VISA", "MASTERCARD")).build();
           Schema targetSchema = ConnectEnum.builder("Card", 
Arrays.asList("VISA", "MASTERCARD", "AMEX")).build();
           // If the Compatibility is Backward, here shoudn't throw exception
           Object projected = SchemaProjector.project(sourceSchema, Card.VISA, 
targetSchema);
   ```
   
   My proposal is to add an interface like:
   interface Projectable {
   void checkCompatible(Schema source, Schema target, Compatibility 
compatibility)
   }
   and a schema class like:
   class ProjectableConnectSchema extends ConnectSchema implements Projectable
   and then, SchemaProjector can call Logical schemas to check their 
compatibility 
   What do you think?
   
   I would like to start a KIP about this improvement. If you can help me with 
it, it's my honor.
   For this PR. I agree with you about the Date/Time/Timestamp convert. So, the 
PR is not needed. We can close it.
   
   


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