Add native stringview support for RIGHT#11955
Merged
alamb merged 6 commits intoapache:mainfrom Aug 13, 2024
Merged
Conversation
Contributor
Author
|
Pasting a possible implementation of |
| let string_array = as_string_view_array(&args[0])?; | ||
| let n_array = as_int64_array(&args[1])?; | ||
|
|
||
| let result = string_array |
Contributor
There was a problem hiding this comment.
Code below is quite similar to the string_right function, I wonder if it is possible to use the ArrayAccessor to reuse the code:
https://github.com/apache/arrow-rs/blob/a693f0f9c37567b2b121e261fc0a4587776d5ca4/arrow-array/src/array/mod.rs#L438-L531
Contributor
Author
There was a problem hiding this comment.
Thanks for the advice. I couldn't come up with a proper way to combine them but now I get it :)
alamb
approved these changes
Aug 13, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
Thank you @Kev1n8 and @XiangpengHao -- very nice
| 01)Projection: right(test.column1_utf8view, Int64(3)) AS c2 | ||
| 02)--TableScan: test projection=[column1_utf8view] | ||
|
|
||
| # Test outputs of RIGHT |
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
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?
Closes #11917
Rationale for this change
What changes are included in this PR?
Update signature of RIGHT to accept Utf8View and add some tests for that.
Are these changes tested?
yes
Are there any user-facing changes?
no