-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: support upper and lower for stringview #12138
Conversation
5737c20
to
5709f3b
Compare
5709f3b
to
b4e0974
Compare
@@ -214,6 +214,23 @@ where | |||
i64, | |||
_, | |||
>(array, op)?)), | |||
DataType::Utf8View => { | |||
let string_array = as_string_view_array(array)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure happy with this implementation, but it seems to work. I tried something akin to:
let result = string_array.iter().map(|string| string.map(op));
but that seems to require a clone of op
which isn't allowed based on the existing function definition, and seems worth avoiding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this implemenation looks reasonable to me. Thanks @tshauck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me -- thanks @tshauck
@@ -214,6 +214,23 @@ where | |||
i64, | |||
_, | |||
>(array, op)?)), | |||
DataType::Utf8View => { | |||
let string_array = as_string_view_array(array)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this implemenation looks reasonable to me. Thanks @tshauck
Which issue does this PR close?
Closes #11855
Rationale for this change
The Utf8View type are currently cast into Utf8 types. This PR updates the
lower
(andupper
) functions(s) to support the type natively.What changes are included in this PR?
Added a specific path for Utf8Views to upper and lower.
Are these changes tested?
Yes, updated the
EXPLAIN
tests to show no cast is performed. Also basic tests to show the actual transformation is done on the utf8view type.Are there any user-facing changes?
No