-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Postgres compliant name aliasing for String Functions. #12795
Conversation
Certain String function names are not Postgres compliant, added aliasing to fix that. - left - right - split_part - string_to_array
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12795 +/- ##
============================================
+ Coverage 61.75% 62.03% +0.28%
+ Complexity 207 198 -9
============================================
Files 2436 2461 +25
Lines 133233 134778 +1545
Branches 20636 20824 +188
============================================
+ Hits 82274 83610 +1336
- Misses 44911 45010 +99
- Partials 6048 6158 +110
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Would be good to add a test for both V1 and V2
@@ -243,7 +243,7 @@ public static String rtrim(String input) { | |||
* @param input | |||
* @return get substring starting from the first index and extending upto specified length. | |||
*/ | |||
@ScalarFunction | |||
@ScalarFunction(names = {"leftSubStr", "left"}) |
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.
Is leftSubStr
a valid function in any common DB? Should we add the underscore version?
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 had checked, with v1, all variations are supported left_substr
, leftSubStr
, left_sub_str
, which is why I didn't add them explicitly. For v2, we want to be Postgres compliant, so there is just left
.
Yes, agree. I don't see any existing tests for most of these functions. If we want to test aliasing, it can't be unit test for the functions, it has to go through sql compilation. This can be a followup. |
Certain String function names are not Postgres compliant, added aliasing to fix that.