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 2019/04/26 23:36:23 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #4147: Added schema information and unittests for primitive schema types

jerrypeng commented on a change in pull request #4147: Added schema information and unittests for primitive schema types
URL: https://github.com/apache/pulsar/pull/4147#discussion_r279130950
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
 ##########
 @@ -146,6 +146,10 @@ public void close() throws Exception {
 
     private boolean isCompatible(SchemaAndMetadata existingSchema, SchemaData newSchema,
                                  SchemaCompatibilityStrategy strategy) {
+        if (SchemaType.isPrimitiveSchemaType(existingSchema.schema.getType())) {
+            // for primitive data types, only schema type check is needed
+            return existingSchema.schema.getType() == newSchema.getType();
 
 Review comment:
   @srkukarni even from primitive types you still should check this condition:
   ```
   compatibilityChecks.getOrDefault(newSchema.getType(), SchemaCompatibilityCheck.DEFAULT)
               .isCompatible(existingSchema.schema, newSchema, strategy);	            .isCompatible(existingSchema.schema, newSchema, strategy)
   ```

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


With regards,
Apache Git Services