Skip to content
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

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Sep 20, 2024

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.

@paleolimbot paleolimbot marked this pull request as ready for review September 20, 2024 15:55
@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@@ -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;
Copy link
Member

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)?

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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!)

@paleolimbot paleolimbot merged commit 120a8e1 into apache:main Sep 20, 2024
34 checks passed
@paleolimbot paleolimbot added this to the nanoarrow 0.6.0 milestone Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants