-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enhance list casting, adding more cases for list views #9274
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
Open
Jefffrey
wants to merge
23
commits into
apache:main
Choose a base branch
from
Jefffrey:enhance-list-casting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+930
−347
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e.g. cast ListView(Int32) to ListView(Float32)
e.g. Int32 to ListView(Int32) [1, 2, 3] -> [[1], [2], [3]]
e.g. FixedSizeList(Int32, 2) -> ListView(Float32)
e.g. List(Int32) -> ListView(Float32); previously we didn't account for inner types differing so it would cast to ListView(Int32) only
Contributor
Author
|
I would recommend reviewing commit by commit, as the commits more clearly show which changes are new features vs refactors, and each commit should be a manageable diff size to review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
While we do have support for casting list views, some cases are missing. This PR goes through the list casting logic for all list types and tries to ensure we have comprehensive & consistent coverage for casting cases, also refactoring to try make this coverage more obvious at a glance.
What changes are included in this PR?
This PR has a mix of new features (new casts supported) and refactoring.
New features:
List/LargeListtoUtf8ViewUtf8/LargeUtf8, but view was missingListView/LargeListViewto string typesListViewtoLargeListView, but castingListView<Int32>toListView<Float32>was not supported; this adds that ability, which regularListarrays supportedListView/LargeListViewFixedSizeListtoListView/LargeListViewList/LargeListtoListView/LargeListViewwhen inner types differListtoLargeListView,LargeListtoListView,ListViewtoLargeList,LargeListViewtoListListView/LargeListViewtoFixedSizeListRefactors:
cast_with_optionsto organize the list casts together so it's easier to see we have coverage for casting between all list typesarrow-cast/src/cast/list_view.rsmerged intoarrow-cast/src/cast/list.rs) since it's easier to track them together, especially with the cross list <-> listview cast functionsAre these changes tested?
Yes, added new tests.
Are there any user-facing changes?
No.