pitrou commented on code in PR #50839:
URL: https://github.com/apache/arrow/pull/50839#discussion_r4193410130
##########
docs/source/format/Columnar.rst:
##########
@@ -864,6 +864,12 @@ A union is defined by an ordered sequence of types; each
slot in the
union can have a value chosen from these types. The types are named
like a struct's fields, and the names are part of the type metadata.
+Each child type in a union has a type id (an 8-bit signed integer)
+that identifies it in the types buffer. By default, these type ids
+correspond directly to the child array indices (0, 1, ...), but an optional
+``typeIds`` metadata array can provide an explicit mapping from child array
+offset to type id.
Review Comment:
```suggestion
Each child type in a union has a logical type id (an 8-bit signed integer)
that identifies it in the types buffer. By default, these type ids
correspond directly to the child array indices (0, 1, ...), but an optional
``typeIds`` metadata array can provide an explicit mapping from child array
index to type id.
```
##########
docs/source/format/Columnar.rst:
##########
@@ -878,10 +884,10 @@ Dense union represents a mixed-type array with 5 bytes of
overhead for
each value. Its physical layout is as follows:
* One child array for each type
-* Types buffer: A buffer of 8-bit signed integers. Each type in the
- union has a corresponding type id whose values are found in this
- buffer. A union with more than 128 possible types can be modeled as
- a union of unions.
+* Types buffer: A buffer of 8-bit signed integers, indicating the type
+ id of each slot. Note that these type ids are not necessarily the
+ same as the child array index (see above). A union with more than 128
+ possible types can be modeled as a union of unions.
Review Comment:
```suggestion
* Types buffer: A buffer of 8-bit signed integers, indicating the logical
type
id of each slot. Note that these type ids are not necessarily the
same as the child array index (see above). A union with more than 128
possible types can be modeled as a union of unions.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]