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


##########
src/nanoarrow/nanoarrow.h:
##########
@@ -835,6 +838,15 @@ static inline ArrowErrorCode ArrowArrayAppendString(struct 
ArrowArray* array,
 /// length of the child array(s) did not match the expected length.
 static inline ArrowErrorCode ArrowArrayFinishElement(struct ArrowArray* array);
 
+/// \brief Finish a union array element
+///
+/// Appends an element to the union type ids buffer and increments 
array->length.
+/// For sparse unions, up to one element is added to non type-id children. 
Returns
+/// EINVAL if the underlying storage type is not a union, if type_id is not 
valid,
+/// or if child sizes after appending are inconsistent.
+static inline ArrowErrorCode ArrowArrayFinishUnionElement(struct ArrowArray* 
array,
+                                                          int32_t type_id);

Review Comment:
   Since append mode is a very specific feature, think it's OK to assume 
equality here. I added a check in `ArrowArrayInitFromSchema()` + 
`ArrowArrayStartAppending()`, which I think will be OK until further support is 
needed.



-- 
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]

Reply via email to