You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Marian S (JIRA)" <ji...@apache.org> on 2017/03/15 09:15:41 UTC

[jira] [Updated] (AVRO-2006) Java union index serialization/deserialization is incorrect

     [ https://issues.apache.org/jira/browse/AVRO-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marian S updated AVRO-2006:
---------------------------
    Description: 
According to the specification "A union is encoded by first writing a long value indicating the zero-based position within the union". See:
https://avro.apache.org/docs/1.8.1/spec.html#Unions

However in java implementation index is encoded as an int (which is 32 bits) see: https://avro.apache.org/docs/1.8.1/api/java/org/apache/avro/io/Encoder.html#writeIndex(int)

This causes inconsistencies betewwn diffrent languages, because for instance I can't deserialize avro serialized with Java using Python, because Python expects long (64 bits) as an index of an union.

  was:
According to the specification "A union is encoded by first writing a long value indicating the zero-based position within the union":

However in java implementation index is encoded as an int (which is 32 bits) see: https://avro.apache.org/docs/1.8.1/api/java/org/apache/avro/io/Encoder.html#writeIndex(int)

This causes inconsistencies betewwn diffrent languages, because for instance I can't deserialize avro serialized with Java using Python, because Python expects long (64 bits) as an index of an union.


> Java union index serialization/deserialization is incorrect
> -----------------------------------------------------------
>
>                 Key: AVRO-2006
>                 URL: https://issues.apache.org/jira/browse/AVRO-2006
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.1
>            Reporter: Marian S
>
> According to the specification "A union is encoded by first writing a long value indicating the zero-based position within the union". See:
> https://avro.apache.org/docs/1.8.1/spec.html#Unions
> However in java implementation index is encoded as an int (which is 32 bits) see: https://avro.apache.org/docs/1.8.1/api/java/org/apache/avro/io/Encoder.html#writeIndex(int)
> This causes inconsistencies betewwn diffrent languages, because for instance I can't deserialize avro serialized with Java using Python, because Python expects long (64 bits) as an index of an union.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)