Skip to content

feat: add ListView and LargeListView support to arrow-ord#9347

Open
codephage2020 wants to merge 6 commits intoapache:mainfrom
codephage2020:issue-9341
Open

feat: add ListView and LargeListView support to arrow-ord#9347
codephage2020 wants to merge 6 commits intoapache:mainfrom
codephage2020:issue-9341

Conversation

@codephage2020
Copy link
Contributor

Which issue does this PR close?

Closes #9341.

Rationale for this change

arrow-ord doesnot support ListView

What changes are included in this PR?

add ListView/LargeListView support to the arrow-ord module

Are these changes tested?

Yes, all changes are thoroughly tested

Are there any user-facing changes?

New APIs:

arrow_ord::comparison::in_list_view() - Check if primitive array values exist in a ListView array
arrow_ord::comparison::in_list_view_utf8() - Check if string array values exist in a ListView array

Enhanced Functionality:

arrow_ord::sort::sort_to_indices() now supports ListView and LargeListView types
arrow_ord::sort::sort() now supports ListView and LargeListView types

@github-actions github-actions bot added the arrow Changes to the arrow crate label Feb 3, 2026
}

/// Checks if each value in the [`PrimitiveArray`] is contained in the corresponding [`GenericListViewArray`] element
pub fn in_list_view<T, OffsetSize>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I'm not sure about adding these kernels; I don't know if in_list() and in_list_utf8() are commonly used (they don't seem to be used in DataFusion for example) and they do seem a bit oddly implemented (in that the base version accepts only primitive, and the string version accepts only Utf8/LargeUtf8 and not Utf8View) 🤔

Perhaps we can hold off on implementing these unless there's a motivating usecase for them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jefffrey Thank you! I completely agree that we should prioritize the core sorting functionality. I'll update the PR .

Regarding the API inconsistency you mentioned with in_list() and in_list_utf8(), I think that's a valid technical debt issue that should be discussed separately. Perhaps we should consider unifying these APIs or designing a more generic contains-style kernel?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be a reasonable approach; I don't have any strong feelings on it (whether keep it as is or try improve it) other than not following in its footsteps 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ListView in sort kernel

3 participants