Add native stringview support for RIGHT#11955
Conversation
|
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 |
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
Similar to this pr: https://github.com/apache/datafusion/pull/11884/files#diff-e49633ca67d4035f244e96909aa4d9d9a484a933a7783bcdee3a6cf32dcd7ab8R76
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
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 |
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