You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2021/05/02 14:53:35 UTC

[GitHub] [avro] tjwp commented on a change in pull request #1082: AVRO-3036: add schema matching for bytes decimal logical type in Ruby

tjwp commented on a change in pull request #1082:
URL: https://github.com/apache/avro/pull/1082#discussion_r624707189



##########
File path: lang/ruby/lib/avro/schema.rb
##########
@@ -467,6 +475,11 @@ def to_avro(names=nil)
         hsh = super
         hsh.size == 1 ? type : hsh
       end
+
+      def match_schema?(schema)
+        return type_sym == schema.type_sym

Review comment:
       This is actually just for the primitive, non-named types to ensure that they are the same type.
   
   Primarily it is used from this modified line https://github.com/apache/avro/pull/1082/files/7ea99640fd96204dcb217133da6c3c6394ef043c#diff-5fa6692791f1794cd9064f4288aff1c2447925b993f77196d09b9bb6a05c910fR49, since that call only applies to primitive types only. 
   
   It's somewhat redundant right now since the call is nested within a `w_type == r_type` condition. But I was trying to move the compatibility checked into a more object-oriented direction.
   
   It is also called from as `super` from the `BytesSchema#match_schema?`.




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