You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/21 13:35:47 UTC

[GitHub] [pulsar] gaoran10 commented on pull request #10604: [Schema] Support consume multiple schema types messages by AutoConsumeSchema

gaoran10 commented on pull request #10604:
URL: https://github.com/apache/pulsar/pull/10604#issuecomment-845954875


   There are still two problems that need to be resolved when consuming keyValue schema data.
   
   1. The keyValue schema data encoding does not consider the KeyValueEncodingType, so if the key and value schema are some but not some KeyValueEncodingType, this will cause an error when decoding message data.
   
       For example, these two schemas belong to one topic, there will be only one schema version due to they have the same schema data.
   ```
   Schema.KeyValue(Schema.JSON(Schemas.PersonOne.class),
                           Schema.JSON(Schemas.PersonFour.class), KeyValueEncodingType.SEPARATED)
   Schema.KeyValue(Schema.JSON(Schemas.PersonOne.class),
                           Schema.JSON(Schemas.PersonFour.class), KeyValueEncodingType.INLINE)
   ```
   
   2. Primitive schemas have empty schema data, this will cause the KeyValue schema data doesn't distinguish different primitive schemas.
   
       For example.
   ```
   Schema.KeyValue(Schema.INT32, Schema.JSON(Schemas.PersonThree.class), KeyValueEncodingType.SEPARATED)
   Schema.KeyValue(Schema.BOOL, Schema.JSON(Schemas.PersonThree.class), KeyValueEncodingType.SEPARATED)
   ```
   
   Maybe we could adjust the key-value schema encoding logic.
   


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

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