Paul Tzen created AVRO-2907:
-------------------------------

             Summary: Ruby schema.single_object_schema_fingerprint is reversed
                 Key: AVRO-2907
                 URL: https://issues.apache.org/jira/browse/AVRO-2907
             Project: Apache Avro
          Issue Type: Bug
          Components: ruby
    Affects Versions: 1.10.0
            Reporter: Paul Tzen


The Ruby 
[schema.single_object_schema_fingerprint|https://github.com/apache/avro/blob/release-1.10.0/lang/ruby/lib/avro/schema.rb#L180]
 method (originally added in [this PR|https://github.com/apache/avro/pull/317]) 
seems to return an incorrect fingerprint, which is reversed from what the [Java 
implementation|https://github.com/apache/avro/blob/release-1.10.0/lang/java/avro/src/main/java/org/apache/avro/SchemaNormalization.java#L64]
 returns.

I believe that the cause is the unnecessary reverse array traversal order on 
[this 
line|https://github.com/apache/avro/blob/release-1.10.0/lang/ruby/lib/avro/schema.rb#L184]
 during the bit masking + shifting operation for converting the fingerprint 
into a little endian byte array.

I'll also drop a comment in the [original 
PR|https://github.com/apache/avro/pull/317] that implements this Ruby 
functionality and see if there's more to the story.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to