[feat](function) SUBSTRING_INDEX function delimiter supports dynamic#50149
Merged
yiguolei merged 7 commits intoapache:masterfrom Apr 22, 2025
Merged
[feat](function) SUBSTRING_INDEX function delimiter supports dynamic#50149yiguolei merged 7 commits intoapache:masterfrom
yiguolei merged 7 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33675 ms |
TPC-DS: Total hot run time: 193725 ms |
ClickBench: Total hot run time: 29.03 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
Author
|
run cloud_p0 |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34103 ms |
TPC-DS: Total hot run time: 192562 ms |
ClickBench: Total hot run time: 29.89 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Merged
8 tasks
HappenLee
reviewed
Apr 18, 2025
| while (num <= part_number && offset >= 0) { | ||
| offset = (int)substr.rfind(delimiter, offset); | ||
|
|
||
| std::string delimiter_str(reinterpret_cast<const char*>(delimiter.data), |
Contributor
There was a problem hiding this comment.
why not use StringRef of std::string_view
1e2a77a to
0027702
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34197 ms |
TPC-DS: Total hot run time: 191897 ms |
ClickBench: Total hot run time: 29.85 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33561 ms |
TPC-DS: Total hot run time: 192315 ms |
ClickBench: Total hot run time: 29.97 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-DS: Total hot run time: 184369 ms |
ClickBench: Total hot run time: 29.12 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33949 ms |
TPC-DS: Total hot run time: 192729 ms |
ClickBench: Total hot run time: 29.47 s |
Contributor
Author
|
run p0 |
Contributor
Author
|
run cloud_p0 |
Contributor
|
PR approved by at least one committer and no changes requested. |
github-actions bot
pushed a commit
that referenced
this pull request
Apr 22, 2025
…50149) ### What problem does this PR solve? Problem Summary: sql ``` SELECT t1.no ,t1.sub_str ,t1.str ,substring_index(t1.str, t1.sub_str, -1) ,t2.rst2 FROM ( SELECT 1 AS no, 'BBB' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, 'zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06' AS str UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, 'sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06' AS str UNION ALL SELECT 5 AS no, 'eee' AS sub_str, 'cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, 'AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06' AS str ) t1 LEFT JOIN ( SELECT 1 AS no, 'BBB' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'BBB', -1) AS rst2 UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, substring_index('zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06', 'ccc', -1) AS rst2 UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'DDD', -1) AS rst2 UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, substring_index('sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06', 'DDD', -1) AS rst2 UNION ALL SELECT 5 AS no, 'eee' AS sub_str, substring_index('cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06', 'eee', -1) AS rst2 UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, substring_index('AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06', 'A_01', -1) AS rst2 ) t2 ON t1.no = t2.no AND t1.sub_str = t2.sub_str ORDER BY t1.no; ``` previous results for doris: ``` -- master function except for the first argument, other parameter must be a constant -- 2.1 +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(`t1`.`str`, `t1`.`sub_str`, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ ``` mysql result: ``` +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` current doris results: ``` +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` now consistent with mysql behavior.
github-actions bot
pushed a commit
that referenced
this pull request
Apr 22, 2025
…50149) ### What problem does this PR solve? Problem Summary: sql ``` SELECT t1.no ,t1.sub_str ,t1.str ,substring_index(t1.str, t1.sub_str, -1) ,t2.rst2 FROM ( SELECT 1 AS no, 'BBB' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, 'zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06' AS str UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, 'sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06' AS str UNION ALL SELECT 5 AS no, 'eee' AS sub_str, 'cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, 'AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06' AS str ) t1 LEFT JOIN ( SELECT 1 AS no, 'BBB' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'BBB', -1) AS rst2 UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, substring_index('zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06', 'ccc', -1) AS rst2 UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'DDD', -1) AS rst2 UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, substring_index('sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06', 'DDD', -1) AS rst2 UNION ALL SELECT 5 AS no, 'eee' AS sub_str, substring_index('cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06', 'eee', -1) AS rst2 UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, substring_index('AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06', 'A_01', -1) AS rst2 ) t2 ON t1.no = t2.no AND t1.sub_str = t2.sub_str ORDER BY t1.no; ``` previous results for doris: ``` -- master function except for the first argument, other parameter must be a constant -- 2.1 +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(`t1`.`str`, `t1`.`sub_str`, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ ``` mysql result: ``` +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` current doris results: ``` +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` now consistent with mysql behavior.
Closed
KassieZ
pushed a commit
to apache/doris-website
that referenced
this pull request
May 20, 2025
…2300) because: apache/doris#50149 ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built
koarz
pushed a commit
to koarz/doris
that referenced
this pull request
Jun 4, 2025
…pache#50149) ### What problem does this PR solve? Problem Summary: sql ``` SELECT t1.no ,t1.sub_str ,t1.str ,substring_index(t1.str, t1.sub_str, -1) ,t2.rst2 FROM ( SELECT 1 AS no, 'BBB' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, 'zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06' AS str UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, 'AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, 'sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06' AS str UNION ALL SELECT 5 AS no, 'eee' AS sub_str, 'cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06' AS str UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, 'AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06' AS str ) t1 LEFT JOIN ( SELECT 1 AS no, 'BBB' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'BBB', -1) AS rst2 UNION ALL SELECT 2 AS no, 'ccc' AS sub_str, substring_index('zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06', 'ccc', -1) AS rst2 UNION ALL SELECT 3 AS no, 'DDD' AS sub_str, substring_index('AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06', 'DDD', -1) AS rst2 UNION ALL SELECT 4 AS no, 'DDD' AS sub_str, substring_index('sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06', 'DDD', -1) AS rst2 UNION ALL SELECT 5 AS no, 'eee' AS sub_str, substring_index('cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06', 'eee', -1) AS rst2 UNION ALL SELECT 6 AS no, 'A_01' AS sub_str, substring_index('AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06', 'A_01', -1) AS rst2 ) t2 ON t1.no = t2.no AND t1.sub_str = t2.sub_str ORDER BY t1.no; ``` previous results for doris: ``` -- master function except for the first argument, other parameter must be a constant -- 2.1 +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(`t1`.`str`, `t1`.`sub_str`, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------------+-------------------------------------------+ ``` mysql result: ``` +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +----+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` current doris results: ``` +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | no | sub_str | str | substring_index(t1.str, t1.sub_str, -1) | rst2 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ | 1 | BBB | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | _02|CCC_03|DDD_04|EEE_05|FFF_06 | | 2 | ccc | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | zyz_01|zyz_02|CCC_03|qwe_04|qwe_05|qwe_06 | | 3 | DDD | AAA_01|BBB_02|CCC_03|DDD_04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | _04|EEE_05|FFF_06 | | 4 | DDD | sgr_01|wsc_02|CCC_03|DDD_04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | _04|rfv_05|rgb_06 | | 5 | eee | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | cdr_01|vfr_02|dfc_03|DDD_04|EEE_05|FFF_06 | | 6 | A_01 | AAA_01|dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | |dsd_02|ert_03|bgt_04|fgh_05|hyb_06 | +------+---------+-------------------------------------------+-------------------------------------------+-------------------------------------------+ ``` now consistent with mysql behavior.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Problem Summary:
sql
previous results for doris:
mysql result:
current doris results:
now consistent with mysql behavior.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)