You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/03/29 01:16:17 UTC

[GitHub] [arrow-nanoarrow] paleolimbot commented on a diff in pull request #174: feat: Implement `ArrowArrayViewValidateFull()`

paleolimbot commented on code in PR #174:
URL: https://github.com/apache/arrow-nanoarrow/pull/174#discussion_r1151298323


##########
src/nanoarrow/nanoarrow_types.h:
##########
@@ -503,7 +503,8 @@ struct ArrowArrayView {
   ///
   /// If storage_type is a union type, a 256-byte ArrowMalloc()ed buffer
   /// such that child_index == union_type_id_map[type_id] and
-  /// type_id == union_type_id_map[128 + child_index]
+  /// type_id == union_type_id_map[128 + child_index]. This value may be
+  /// NULL in the case where child_id == type_id.

Review Comment:
   This is an implementation detail of the `ArrowArrayView`...in the spec the type ids are always there. Arguably they should always be here, too, but there's at least one test that exploits that behaviour that I discovered so I figured I should probably document it. I think the reason it ended up that way was because you can `ArrowArrayViewInitFromType()` and `ArrowArrayViewAllocateChildren()` and letting the type id map stay NULL saves some special casing of unions there.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org