You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "315157973 (via GitHub)" <gi...@apache.org> on 2023/03/09 09:04:00 UTC

[GitHub] [pulsar] 315157973 commented on a diff in pull request #19753: [cleanup][broker] Remove duplicate code in the SchemaRegistryServiceImpl that checks for existing schema and new schema types

315157973 commented on code in PR #19753:
URL: https://github.com/apache/pulsar/pull/19753#discussion_r1130681441


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:
##########
@@ -350,15 +350,9 @@ private void checkCompatible(SchemaAndMetadata existingSchema, SchemaData newSch
                                  SchemaCompatibilityStrategy strategy) throws IncompatibleSchemaException {
         SchemaHash existingHash = SchemaHash.of(existingSchema.schema);
         SchemaHash newHash = SchemaHash.of(newSchema);
-        SchemaData existingSchemaData = existingSchema.schema;
-        if (newSchema.getType() != existingSchemaData.getType()) {
-            throw new IncompatibleSchemaException(String.format("Incompatible schema: "
-                            + "exists schema type %s, new schema type %s",
-                    existingSchemaData.getType(), newSchema.getType()));
-        }
         if (!newHash.equals(existingHash)) {

Review Comment:
   I think the compatibility check should be cohesive to checkCompatible instead of scattered outside, so I suggest to remove the outer check



-- 
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: commits-unsubscribe@pulsar.apache.org

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