eolivelli commented on a change in pull request #9612:
URL: https://github.com/apache/pulsar/pull/9612#discussion_r580069206



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
##########
@@ -293,12 +295,28 @@ private void checkCompatible(SchemaAndMetadata 
existingSchema, SchemaData newSch
             SchemaData schemaData) {
         final CompletableFuture<SchemaVersion> completableFuture = new 
CompletableFuture<>();
         SchemaVersion schemaVersion;
-        for (SchemaAndMetadata schemaAndMetadata : schemaAndMetadataList) {
-            if 
(Arrays.equals(hashFunction.hashBytes(schemaAndMetadata.schema.getData()).asBytes(),
-                    hashFunction.hashBytes(schemaData.getData()).asBytes())) {
-                schemaVersion = schemaAndMetadata.version;
-                completableFuture.complete(schemaVersion);
-                return completableFuture;
+        if (schemaData.getData().length != 0) {
+            Schema.Parser parser = new Schema.Parser();
+            Schema newSchema = parser.parse(new String(schemaData.getData(), 
UTF_8));

Review comment:
       very good!
   
   we are still missing PROTOBUF tests, correct ?




----------------------------------------------------------------
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:
[email protected]


Reply via email to