[ 
https://issues.apache.org/jira/browse/AVRO-2907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17195399#comment-17195399
 ] 

ASF subversion and git services commented on AVRO-2907:
-------------------------------------------------------

Commit 322ba39e68893745f0d40fb5ccc642756507898a in avro's branch 
refs/heads/master from ypt
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=322ba39 ]

AVRO-2907: Fix Ruby single object encoding fingerprint and header (#937)

The bit masking + shifting operation should already result in grabbing
the least significant bytes first for the little endian CRC-64
fingerprint in the header - so traversing the array in reverse order is
unnecessary.

> 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
>            Priority: Minor
>
> 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