WillAyd commented on code in PR #808:
URL: https://github.com/apache/arrow-nanoarrow/pull/808#discussion_r2373486534
##########
src/nanoarrow/common/array.c:
##########
@@ -463,47 +471,54 @@ static ArrowErrorCode ArrowArrayFinalizeBuffers(struct
ArrowArray* array) {
}
for (int64_t i = 0; i < array->n_children; i++) {
- NANOARROW_RETURN_NOT_OK(ArrowArrayFinalizeBuffers(array->children[i]));
+ if (ArrowArrayIsInternal(array->children[i])) {
+ NANOARROW_RETURN_NOT_OK(ArrowArrayFinalizeBuffers(array->children[i]));
+ }
}
- if (array->dictionary != NULL) {
+ if (array->dictionary != NULL && ArrowArrayIsInternal(array->dictionary)) {
NANOARROW_RETURN_NOT_OK(ArrowArrayFinalizeBuffers(array->dictionary));
}
return NANOARROW_OK;
}
-static void ArrowArrayFlushInternalPointers(struct ArrowArray* array) {
+static ArrowErrorCode ArrowArrayFlushInternalPointers(struct ArrowArray*
array) {
struct ArrowArrayPrivateData* private_data =
(struct ArrowArrayPrivateData*)array->private_data;
- const bool is_binary_view = private_data->storage_type ==
NANOARROW_TYPE_STRING_VIEW ||
- private_data->storage_type ==
NANOARROW_TYPE_BINARY_VIEW;
- const int32_t nfixed_buf = is_binary_view ? 2 : NANOARROW_MAX_FIXED_BUFFERS;
+ if (array->n_buffers > NANOARROW_MAX_FIXED_BUFFERS) {
Review Comment:
Ah OK - I think that makes sense. I totally forgot about the variadic sizes
buffer, and was mistakenly assuming that there would just be a single variadic
buffer holding the data (assuming not everything was inline)
--
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]