paleolimbot commented on code in PR #808:
URL: https://github.com/apache/arrow-nanoarrow/pull/808#discussion_r2373481251
##########
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:
I *think* that if you have one variadic buffer you would have four total
(validity, data, variadic, variadic sizes) (this PR sort of conceptualizes the
variadic sizes buffer as fixed because it is always present, even though its
index in the buffer list changes).
--
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]