You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Micah Kornfield (Jira)" <ji...@apache.org> on 2021/06/17 04:31:00 UTC
[jira] [Commented] (AVRO-3159) Error in AVRO specification
[ https://issues.apache.org/jira/browse/AVRO-3159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364684#comment-17364684 ]
Micah Kornfield commented on AVRO-3159:
---------------------------------------
This is not an error. 0x02 is the zigzag variable width encoding of index 1.
> Error in AVRO specification
> ---------------------------
>
> Key: AVRO-3159
> URL: https://issues.apache.org/jira/browse/AVRO-3159
> Project: Apache Avro
> Issue Type: Bug
> Components: doc
> Reporter: Dave Cole
> Priority: Minor
>
> On [http://avro.apache.org/docs/current/spec.html#binary_encode_primitive] the example given for encoding Unions appears to have an error:
> {quote}For example, the union schema ["null","string"] would encode:
> null as zero (the index of "null" in the union):
> 00
> the string "a" as one (the index of "string" in the union, encoded as hex 02), followed by the serialized string:
> 02 02 61
> {quote}
> Surely the "string" in the union is encoded as hex 01... It is defined as "the zero-based position within the union of the schema". The list has only two entries, so 02 is not a valid index.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)