-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Only validate relevant type_ids for array view slice #627
Conversation
src/nanoarrow/common/array.c
Outdated
@@ -1298,6 +1298,15 @@ static int ArrowArrayViewValidateFull(struct ArrowArrayView* array_view, | |||
|
|||
if (array_view->storage_type == NANOARROW_TYPE_DENSE_UNION || | |||
array_view->storage_type == NANOARROW_TYPE_SPARSE_UNION) { | |||
struct ArrowBufferView type_ids; | |||
type_ids.size_bytes = array_view->length * sizeof(int8_t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
src/nanoarrow/common/array.c
Outdated
@@ -1298,6 +1298,15 @@ static int ArrowArrayViewValidateFull(struct ArrowArrayView* array_view, | |||
|
|||
if (array_view->storage_type == NANOARROW_TYPE_DENSE_UNION || | |||
array_view->storage_type == NANOARROW_TYPE_SPARSE_UNION) { | |||
struct ArrowBufferView type_ids; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make things clearer/consistenter, should we name this sliced_type_ids
or so? (and rename minimal_offsets -> sliced_offsets
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe later it'd be helpful to extract ArrowArrayViewSlice
which produces an equivalent array view but with offset 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ArrowArrayViewSlice
will be useful for a bunch of things...to get consumer functions to work recursively with list types, many of them already accept ArrowArrayView*, offset, length
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you meant as a function (will also be helpful!)
Similar to #626 but for union type_id arrays. This should fix the two remaining failures in the integration tests between the IPC implementations in the Arrow repository and the nanoarrow IPC implementation apache/arrow#43715.