Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/src/content/xdocs/spec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@

<section id="union_encoding">
<title>Unions</title>
<p>A union is encoded by first writing a <code>long</code>
<p>A union is encoded by first writing an <code>int</code>
value indicating the zero-based position within the
union of the schema of its value. The value is then
encoded per the indicated schema within the union.</p>
Expand All @@ -560,6 +560,8 @@
followed by the serialized string:
<source>02 02 61</source></li>
</ul>
<p><em>NOTE</em>: Currently for C/C++ implementtions, the positions are practically an int, but theoretically a long.
In reality, we don't expect unions with 215M members </p>
</section>

<section id="fixed_encoding">
Expand Down
2 changes: 1 addition & 1 deletion lang/perl/lib/Avro/BinaryDecoder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ sub skip_union {
$class->skip($union_schema, $reader);
}

## 1.3.2 A union is encoded by first writing a long value indicating the
## 1.3.2 A union is encoded by first writing an int value indicating the
## zero-based position within the union of the schema of its value. The value
## is then encoded per the indicated schema within the union.
sub decode_union {
Expand Down
2 changes: 1 addition & 1 deletion lang/perl/lib/Avro/BinaryEncoder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ sub encode_map {
$class->encode_long(undef, 0, $cb);
}

## 1.3.2 A union is encoded by first writing a long value indicating the
## 1.3.2 A union is encoded by first writing an int value indicating the
## zero-based position within the union of the schema of its value. The value
## is then encoded per the indicated schema within the union.
sub encode_union {
Expand Down
4 changes: 2 additions & 2 deletions lang/py/avro/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def skip_map(self, writers_schema, decoder):

def read_union(self, writers_schema, readers_schema, decoder):
"""
A union is encoded by first writing a long value indicating
A union is encoded by first writing an int value indicating
the zero-based position within the union of the schema of its value.
The value is then encoded per the indicated schema within the union.
"""
Expand Down Expand Up @@ -1096,7 +1096,7 @@ def write_map(self, writers_schema, datum, encoder):

def write_union(self, writers_schema, datum, encoder):
"""
A union is encoded by first writing a long value indicating
A union is encoded by first writing an int value indicating
the zero-based position within the union of the schema of its value.
The value is then encoded per the indicated schema within the union.
"""
Expand Down
4 changes: 2 additions & 2 deletions lang/py3/avro/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def skip_map(self, writer_schema, decoder):

def read_union(self, writer_schema, reader_schema, decoder):
"""
A union is encoded by first writing a long value indicating
A union is encoded by first writing an int value indicating
the zero-based position within the union of the schema of its value.
The value is then encoded per the indicated schema within the union.
"""
Expand Down Expand Up @@ -866,7 +866,7 @@ def write_map(self, writer_schema, datum, encoder):

def write_union(self, writer_schema, datum, encoder):
"""
A union is encoded by first writing a long value indicating
A union is encoded by first writing an int value indicating
the zero-based position within the union of the schema of its value.
The value is then encoded per the indicated schema within the union.
"""
Expand Down