Skip to content

Conversation

@felipecrv
Copy link
Contributor

@felipecrv felipecrv commented Sep 9, 2023

Rationale for this change

Currently the is_null kernel always returns all-False for union and run-end-encoded types, since those don't have a top-level validity buffer. Update the kernel to take the logical nulls into account.

Are these changes tested?

Yes, both in Python and C++

Are there any user-facing changes?

Yes, this changes (corrects) the behaviour of the is_null kernel.

Closes #35036

}
}

static void SetSparseUnionLogicalNullBits(const ArraySpan& span, uint8_t* out_bitmap,
Copy link
Member

Choose a reason for hiding this comment

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

Would it be worth reusing the choose kernel for this case?

}

template <typename RunEndCType>
void SetREELogicalNullBits(const ArraySpan& span, uint8_t* out_bitmap,
Copy link
Member

Choose a reason for hiding this comment

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

Here it seems we could trivially create an ree($index_type, bool), then return that directly or decode it using existing utilities

int64_t out_offset) {
const auto* dense_union_type =
::arrow::internal::checked_cast<const DenseUnionType*>(span.type);
DCHECK_LE(span.child_data.size(), 128);
Copy link
Member

Choose a reason for hiding this comment

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

Someday if we have more dense union utilities the same trick as for sparse unions could be used here

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Sep 11, 2023
@github-actions github-actions bot added the Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise label Nov 18, 2025
@thisisnic
Copy link
Member

Thank you for your contribution. Unfortunately, this
pull request has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label
or comment below, or this PR will be closed in 14 days. Feel free to re-open this if it has been closed in error. If you
do not have repository permissions to reopen the PR, please tag a maintainer.

@github-actions github-actions bot removed the Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] pa.compute.is_null() returns incorrect answer for dense union arrays and segfaults for dense union scalars

4 participants