-
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
Support unicode character for initcap
function
#13752
Conversation
Signed-off-by: Tai Le Manh <[email protected]>
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.
Thank you, this looks good to me
@@ -74,7 +76,7 @@ impl ScalarUDFImpl for InitcapFunc { | |||
DataType::LargeUtf8 => make_scalar_function(initcap::<i64>, vec![])(args), | |||
DataType::Utf8View => make_scalar_function(initcap_utf8view, vec![])(args), | |||
other => { | |||
exec_err!("Unsupported data type {other:?} for function initcap") | |||
exec_err!("Unsupported data type {other:?} for function `initcap`") |
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.
exec_err!("Unsupported data type {other:?} for function `initcap`") | |
internal_err!("Unsupported data type {other:?} for function `initcap`") |
Incompatible arg should be checked during planning before, thus here is unreachable, and we can use internal_err
to indicate a potential bug if it's executed
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.
@2010YOUY01 Thanks for reviewing,
Incompatible arg should be checked during planning before, thus here is unreachable, and we can use internal_err to indicate a potential bug if it's executed
Make sense to me👍
@@ -460,7 +460,7 @@ Andrew Datafusion📊🔥 | |||
Xiangpeng Datafusion数据融合 | |||
Raphael Datafusionдатафусион | |||
Under_Score Un Iść Core | |||
Percent Pan Tadeusz Ma Iść W KąT | |||
Percent Pan Tadeusz Ma Iść W Kąt |
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.
I've checked and this result is compatible with PostgreSQL
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.
Thanks @tlm365 It looks good to me but some minor comments.
@@ -213,7 +243,7 @@ mod tests { | |||
Ok(Some("Hi Thomas")), | |||
&str, | |||
Utf8, | |||
StringArray | |||
StringViewArray |
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.
👍
Signed-off-by: Tai Le Manh <[email protected]>
dd5b400
to
1064aa0
Compare
Thanks @tlm365 and @2010YOUY01 for reviewing |
* Support unicode character for 'initcap' function Signed-off-by: Tai Le Manh <[email protected]> * Update unit tests * Fix clippy warning * Update sqllogictests - initcap * Update scalar_functions.md docs * Add suggestions change Signed-off-by: Tai Le Manh <[email protected]> --------- Signed-off-by: Tai Le Manh <[email protected]>
Which issue does this PR close?
Closes #13711.
Rationale for this change
What changes are included in this PR?
initcap
function.initcap
fromstring
module tounicode
module.Are these changes tested?
Yes, unit tests are included.
Are there any user-facing changes?
Yes.
api change
.