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

GH-45167: [C++] Implement Compute Equals for List Types #45272

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WillAyd
Copy link
Contributor

@WillAyd WillAyd commented Jan 15, 2025

Rationale for this change

While equality exists for ListScalars, it is not available through the compute module. This makes that now possible.

What changes are included in this PR?

I have added equals and not_equals support to the compute module for list types

Are these changes tested?

Yes - see added changes

Are there any user-facing changes?

Yes - the new feature to allow list comparison through the compute module

Copy link

⚠️ GitHub issue #45167 has been automatically assigned in GitHub to PR creator.

position(arr.offset) {}

T operator()() {
// TODO: how cann we avoid the ToArray call
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the remaining piece that needs to be fixed. I noticed the test failures appear when taking slices of the Arrays, and I think that ends up flattening potentially chunked arrays into a single array given this ToArray call.

Is there some other facility already in the code base to help get a ListScalar from an ArraySpan that I may be overlooking? If not, should that be implemented here directly, or somewhere within the ArraySpan class?

AFAICT the ArraySpan class only returns pointers to physical, primitive types at the moment

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 15, 2025
@WillAyd WillAyd force-pushed the implement-list-compare branch from 573867e to 649e3b0 Compare January 16, 2025 20:09
const auto child_offset = values.offset;

// TODO: do not hard code child type. also need to be aware of non-primitive children
const auto array_data = ArrayData::Make(int32(), len, std::move(bufs), null_count,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely do not want to hard code the data type here but I'm not sure what facilities can help select from the ListArray generically - do these exist already or would they need to be built out in this function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant