-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Fix](sql function)Fix split_part function behavior #36231
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
clang-tidy review says "All clean, LGTM! 👍" |
3 similar comments
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
please add description about what's the behavior before |
run buildall |
TPC-H: Total hot run time: 39916 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 174398 ms
|
ClickBench: Total hot run time: 30.8 s
|
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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.
LGTM
4decd9f
to
00bae9e
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39352 ms
|
TPC-DS: Total hot run time: 172840 ms
|
ClickBench: Total hot run time: 30.87 s
|
We're closing this PR because it hasn't been updated in a while. |
Proposed changes
Issue Number: close #xxx
If the delimiter does not exist in the string, it is returned unchanged, changed to the same behavior as pg/trino
Before behavior change
mysql> select split_part('abc', '|', 1);
+---------------------------+
| split_part('abc', '|', 1) |
+---------------------------+
| NULL |
+---------------------------+
1 row in set (0.02 sec)
After behavior change
`mysql> select split_part('abc', '|', 1);
+---------------------------+
| split_part('abc', '|', 1) |
+---------------------------+
| abc |
+---------------------------+
1 row in set (0.01 sec)
mysql> select split_part('abc', '||', 1);
+----------------------------+
| split_part('abc', '||', 1) |
+----------------------------+
| abc |
+----------------------------+
1 row in set (0.01 sec)
mysql> select split_part('abc', '|', -1);
+----------------------------+
| split_part('abc', '|', -1) |
+----------------------------+
| abc |
+----------------------------+
1 row in set (0.00 sec)
mysql> select split_part('abc', '||', -1);
+-----------------------------+
| split_part('abc', '||', -1) |
+-----------------------------+
| abc |
+-----------------------------+
1 row in set (0.00 sec)`