Skip to content
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](Nereids) fix fe folding constant of string functions and add more cases #45233

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

LiBinfeng-01
Copy link
Collaborator

@LiBinfeng-01 LiBinfeng-01 commented Dec 10, 2024

Issue Number: close #44666

Related PR: #40441

Problem Summary:

  • select substring_index('哈哈哈AAA','A', 1);
    String.split function has second parameter 'limit', which is default zero. When 'limit' is zero, it means it would remove trailing
    empty strings split of '哈哈哈AAA', which would be '哈哈哈' only. But what we expect is '哈哈哈', '','','' when part function is used by substring index.
    So we should change splitpart limit to -1 to enable trailing empty character in splitpart list

  • reorganize fold constant of string functions in fe and add more cases

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 40102 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 5e04a814f7934af0155d8428f3550d9cd36570dd, data reload: false

------ Round 1 ----------------------------------
q1	17943	7555	7357	7357
q2	2049	180	180	180
q3	10624	1111	1215	1111
q4	10308	720	702	702
q5	7615	2775	2768	2768
q6	239	148	150	148
q7	994	635	620	620
q8	9240	1846	1879	1846
q9	6715	6519	6494	6494
q10	6948	2318	2353	2318
q11	468	272	255	255
q12	427	226	227	226
q13	17774	3007	3045	3007
q14	240	217	208	208
q15	583	538	531	531
q16	652	562	589	562
q17	999	570	549	549
q18	7558	6579	6684	6579
q19	1337	1052	1071	1052
q20	470	185	179	179
q21	4366	3205	3090	3090
q22	382	320	321	320
Total cold run time: 107931 ms
Total hot run time: 40102 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7282	7246	7317	7246
q2	342	229	230	229
q3	2900	2914	3013	2914
q4	2062	1861	1876	1861
q5	5648	5692	5725	5692
q6	229	141	143	141
q7	2256	1821	1827	1821
q8	3403	3561	3532	3532
q9	8997	9135	9015	9015
q10	3619	3566	3566	3566
q11	610	486	494	486
q12	858	647	638	638
q13	11270	3266	3251	3251
q14	319	275	292	275
q15	583	534	542	534
q16	704	656	644	644
q17	1870	1643	1652	1643
q18	8391	7902	7731	7731
q19	2131	1616	1559	1559
q20	2153	1929	1886	1886
q21	5633	5576	5464	5464
q22	670	601	575	575
Total cold run time: 71930 ms
Total hot run time: 60703 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 198377 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 5e04a814f7934af0155d8428f3550d9cd36570dd, data reload: false

query1	1338	988	932	932
query2	6240	2091	2061	2061
query3	10924	4233	4482	4233
query4	66814	29074	23811	23811
query5	5137	472	451	451
query6	417	185	172	172
query7	5885	299	289	289
query8	317	233	225	225
query9	9251	2717	2710	2710
query10	463	249	261	249
query11	17461	15425	15905	15425
query12	156	108	105	105
query13	1633	422	434	422
query14	11075	8038	7562	7562
query15	213	190	190	190
query16	6734	479	464	464
query17	1167	595	583	583
query18	1078	300	298	298
query19	233	152	149	149
query20	120	110	115	110
query21	203	110	104	104
query22	4761	4622	4610	4610
query23	34989	34483	34733	34483
query24	5477	2611	2617	2611
query25	488	383	378	378
query26	667	153	157	153
query27	1921	286	292	286
query28	4184	2526	2487	2487
query29	671	434	412	412
query30	205	153	157	153
query31	982	847	865	847
query32	69	57	59	57
query33	426	296	300	296
query34	940	533	551	533
query35	913	811	785	785
query36	1080	964	996	964
query37	133	78	80	78
query38	4620	4365	4499	4365
query39	1564	1482	1448	1448
query40	223	103	114	103
query41	49	46	46	46
query42	119	102	100	100
query43	544	536	505	505
query44	1193	852	846	846
query45	196	177	169	169
query46	1190	748	737	737
query47	2015	1911	1895	1895
query48	424	322	329	322
query49	729	389	406	389
query50	847	403	395	395
query51	7361	7135	7094	7094
query52	96	88	92	88
query53	253	210	183	183
query54	509	399	386	386
query55	81	77	85	77
query56	282	228	229	228
query57	1249	1116	1108	1108
query58	211	216	210	210
query59	3085	3096	2957	2957
query60	276	235	243	235
query61	106	101	103	101
query62	771	673	673	673
query63	210	186	211	186
query64	1340	669	630	630
query65	3315	3231	3216	3216
query66	647	300	300	300
query67	16009	15561	15608	15561
query68	4391	551	577	551
query69	423	250	248	248
query70	1173	1149	1154	1149
query71	337	245	236	236
query72	6525	4088	4073	4073
query73	760	361	356	356
query74	10252	9024	9083	9024
query75	3392	2668	2702	2668
query76	1819	1031	1156	1031
query77	472	273	275	273
query78	10574	9569	9459	9459
query79	2226	604	635	604
query80	1329	428	445	428
query81	517	241	226	226
query82	932	117	118	117
query83	241	147	149	147
query84	263	70	79	70
query85	995	307	297	297
query86	429	292	304	292
query87	4761	4511	4597	4511
query88	3539	2241	2206	2206
query89	430	302	294	294
query90	1979	191	190	190
query91	137	106	103	103
query92	74	50	48	48
query93	2448	540	539	539
query94	920	264	289	264
query95	353	251	255	251
query96	627	274	278	274
query97	2851	2689	2685	2685
query98	219	192	192	192
query99	1636	1353	1340	1340
Total cold run time: 321303 ms
Total hot run time: 198377 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.22 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 5e04a814f7934af0155d8428f3550d9cd36570dd, data reload: false

query1	0.03	0.03	0.04
query2	0.08	0.04	0.03
query3	0.24	0.07	0.07
query4	1.63	0.10	0.10
query5	0.44	0.41	0.41
query6	1.17	0.66	0.66
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.57	0.51	0.49
query10	0.56	0.57	0.55
query11	0.14	0.10	0.11
query12	0.14	0.11	0.11
query13	0.61	0.61	0.61
query14	2.82	2.75	2.75
query15	0.90	0.83	0.83
query16	0.39	0.38	0.38
query17	1.05	1.05	1.04
query18	0.22	0.20	0.21
query19	2.00	1.85	2.00
query20	0.02	0.01	0.02
query21	15.37	0.57	0.59
query22	3.09	1.80	1.87
query23	17.31	1.06	0.84
query24	3.23	1.07	0.39
query25	0.24	0.17	0.16
query26	0.37	0.13	0.14
query27	0.04	0.04	0.04
query28	11.30	1.09	1.07
query29	12.57	3.30	3.27
query30	0.24	0.06	0.06
query31	2.86	0.40	0.39
query32	3.27	0.46	0.47
query33	2.99	3.04	3.02
query34	17.03	4.47	4.54
query35	4.50	4.53	4.49
query36	0.66	0.49	0.48
query37	0.10	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.03
query40	0.18	0.14	0.14
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 108.64 s
Total hot run time: 32.22 s

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 40232 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7a9d32b37a86e21f178922de74be9c7071c3d380, data reload: false

------ Round 1 ----------------------------------
q1	17590	7496	7300	7300
q2	2046	179	172	172
q3	10649	1109	1233	1109
q4	10558	763	734	734
q5	7640	2733	2692	2692
q6	238	149	147	147
q7	981	624	608	608
q8	9429	1854	1904	1854
q9	6709	6517	6538	6517
q10	7023	2286	2289	2286
q11	467	259	253	253
q12	437	235	227	227
q13	17781	3013	3022	3013
q14	238	215	224	215
q15	588	520	520	520
q16	639	602	574	574
q17	973	634	588	588
q18	7249	6748	6695	6695
q19	1345	988	1047	988
q20	488	184	180	180
q21	3997	3353	3253	3253
q22	382	313	307	307
Total cold run time: 107447 ms
Total hot run time: 40232 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7243	7273	7307	7273
q2	333	228	234	228
q3	2898	2891	2950	2891
q4	2043	1873	1866	1866
q5	5601	5647	5623	5623
q6	223	142	143	142
q7	2213	1818	1814	1814
q8	3439	3565	3517	3517
q9	8958	9028	9084	9028
q10	3616	3613	3536	3536
q11	591	511	503	503
q12	813	568	621	568
q13	10664	3286	3193	3193
q14	307	274	268	268
q15	585	513	529	513
q16	691	655	635	635
q17	1855	1651	1634	1634
q18	8169	7609	7618	7609
q19	1698	1625	1519	1519
q20	2102	1872	1904	1872
q21	5802	5406	5532	5406
q22	639	609	556	556
Total cold run time: 70483 ms
Total hot run time: 60194 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195402 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7a9d32b37a86e21f178922de74be9c7071c3d380, data reload: false

query1	1321	1015	938	938
query2	6220	2076	1996	1996
query3	11077	4584	4390	4390
query4	66701	28294	23556	23556
query5	5013	457	438	438
query6	404	184	178	178
query7	5454	307	293	293
query8	310	229	214	214
query9	8234	2716	2683	2683
query10	419	244	242	242
query11	16943	15163	15710	15163
query12	155	106	110	106
query13	1448	462	441	441
query14	10552	7541	6582	6582
query15	226	185	198	185
query16	7123	429	503	429
query17	1162	576	580	576
query18	1876	310	315	310
query19	201	156	168	156
query20	122	118	125	118
query21	210	102	108	102
query22	4903	4561	4569	4561
query23	34401	33940	34062	33940
query24	5484	2512	2606	2512
query25	493	371	379	371
query26	661	145	147	145
query27	1991	288	275	275
query28	4287	2491	2438	2438
query29	696	411	401	401
query30	246	149	147	147
query31	1003	807	893	807
query32	68	58	56	56
query33	415	295	286	286
query34	934	532	519	519
query35	883	797	766	766
query36	1069	924	941	924
query37	124	68	81	68
query38	4402	4333	4376	4333
query39	1503	1472	1454	1454
query40	196	96	99	96
query41	44	42	43	42
query42	122	104	104	104
query43	532	499	483	483
query44	1174	838	852	838
query45	188	173	176	173
query46	1204	733	729	729
query47	2063	1940	1955	1940
query48	432	320	318	318
query49	719	394	397	394
query50	844	406	388	388
query51	7377	7258	7182	7182
query52	98	85	93	85
query53	251	173	175	173
query54	514	394	394	394
query55	81	76	83	76
query56	248	260	233	233
query57	1287	1106	1097	1097
query58	218	211	204	204
query59	3174	2920	2784	2784
query60	262	234	236	234
query61	110	104	105	104
query62	798	677	660	660
query63	210	180	177	177
query64	1367	662	622	622
query65	3240	3154	3219	3154
query66	704	313	303	303
query67	16010	15622	15743	15622
query68	3893	563	547	547
query69	438	251	244	244
query70	1208	1057	1120	1057
query71	384	241	245	241
query72	6429	4020	4056	4020
query73	780	357	358	357
query74	10224	8943	8961	8943
query75	3369	2660	2693	2660
query76	1855	1063	1160	1063
query77	533	271	359	271
query78	10366	9456	9380	9380
query79	1569	580	584	580
query80	978	423	419	419
query81	496	222	221	221
query82	664	124	112	112
query83	160	146	143	143
query84	277	69	64	64
query85	878	302	307	302
query86	341	283	285	283
query87	4716	4542	4563	4542
query88	3765	2242	2163	2163
query89	416	300	302	300
query90	2000	184	180	180
query91	139	97	106	97
query92	61	47	51	47
query93	1681	531	526	526
query94	768	288	252	252
query95	350	254	245	245
query96	617	287	281	281
query97	2852	2691	2665	2665
query98	235	201	197	197
query99	1827	1343	1292	1292
Total cold run time: 316470 ms
Total hot run time: 195402 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.39 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7a9d32b37a86e21f178922de74be9c7071c3d380, data reload: false

query1	0.03	0.05	0.03
query2	0.06	0.03	0.04
query3	0.23	0.07	0.07
query4	1.63	0.11	0.10
query5	0.42	0.43	0.41
query6	1.15	0.65	0.65
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.60	0.52	0.49
query10	0.57	0.58	0.55
query11	0.14	0.11	0.11
query12	0.13	0.11	0.11
query13	0.60	0.61	0.60
query14	2.78	2.88	2.72
query15	0.89	0.82	0.82
query16	0.39	0.38	0.37
query17	1.08	1.07	1.07
query18	0.22	0.21	0.21
query19	1.95	1.83	2.02
query20	0.02	0.01	0.01
query21	15.36	0.58	0.60
query22	2.60	2.06	2.47
query23	16.76	1.17	0.84
query24	2.82	0.55	1.59
query25	0.18	0.06	0.13
query26	0.64	0.13	0.13
query27	0.06	0.04	0.05
query28	10.80	1.10	1.08
query29	12.56	3.26	3.20
query30	0.25	0.07	0.06
query31	2.87	0.39	0.37
query32	3.27	0.46	0.45
query33	2.98	2.99	3.03
query34	17.05	4.46	4.50
query35	4.60	4.53	4.53
query36	0.66	0.48	0.47
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.03
query40	0.18	0.13	0.12
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.04	0.03
Total cold run time: 106.9 s
Total hot run time: 32.39 s

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39851 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9a27791a6d1ed9e666a2a82458a5eea683842ceb, data reload: false

------ Round 1 ----------------------------------
q1	17571	7377	7288	7288
q2	2059	172	168	168
q3	10590	1095	1231	1095
q4	10527	785	767	767
q5	7605	2654	2684	2654
q6	240	146	148	146
q7	986	610	607	607
q8	9243	1793	1932	1793
q9	6697	6496	6552	6496
q10	7030	2301	2313	2301
q11	461	256	261	256
q12	429	232	234	232
q13	17796	2994	3015	2994
q14	231	205	214	205
q15	584	525	509	509
q16	635	598	575	575
q17	989	545	511	511
q18	7126	6673	6631	6631
q19	1346	1055	981	981
q20	477	182	181	181
q21	4000	3166	3309	3166
q22	370	319	295	295
Total cold run time: 106992 ms
Total hot run time: 39851 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7261	7230	7229	7229
q2	330	232	232	232
q3	2956	2791	2908	2791
q4	2149	1858	1873	1858
q5	5650	5664	5648	5648
q6	239	149	148	148
q7	2229	1808	1795	1795
q8	3399	3561	3535	3535
q9	8890	9079	9040	9040
q10	3597	3547	3545	3545
q11	591	507	531	507
q12	798	588	616	588
q13	12184	3249	3173	3173
q14	292	270	265	265
q15	580	541	524	524
q16	675	647	636	636
q17	1851	1617	1605	1605
q18	8348	7787	7702	7702
q19	1730	1816	1645	1645
q20	2092	1867	1881	1867
q21	5562	5391	5461	5391
q22	627	590	573	573
Total cold run time: 72030 ms
Total hot run time: 60297 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196138 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9a27791a6d1ed9e666a2a82458a5eea683842ceb, data reload: false

query1	1273	990	930	930
query2	6229	2121	2036	2036
query3	10949	4357	4385	4357
query4	66450	29091	23293	23293
query5	5005	454	433	433
query6	400	171	165	165
query7	5642	320	292	292
query8	335	224	226	224
query9	9206	2712	2693	2693
query10	458	252	245	245
query11	17211	15086	15851	15086
query12	151	108	98	98
query13	1550	428	426	426
query14	11027	7219	7617	7219
query15	218	193	206	193
query16	7300	479	489	479
query17	1223	578	577	577
query18	1832	309	307	307
query19	215	159	164	159
query20	119	111	111	111
query21	217	114	109	109
query22	4883	4675	4729	4675
query23	34302	33921	34116	33921
query24	5572	2469	2469	2469
query25	512	384	429	384
query26	647	152	146	146
query27	1875	279	290	279
query28	4472	2510	2502	2502
query29	677	427	418	418
query30	234	153	146	146
query31	1020	852	846	846
query32	67	53	56	53
query33	398	294	303	294
query34	971	521	518	518
query35	867	791	755	755
query36	1097	941	961	941
query37	127	76	71	71
query38	4460	4330	4435	4330
query39	1473	1469	1426	1426
query40	210	100	97	97
query41	41	42	41	41
query42	116	99	99	99
query43	550	503	501	501
query44	1190	842	842	842
query45	188	164	166	164
query46	1175	751	749	749
query47	2037	1928	1949	1928
query48	421	330	320	320
query49	779	389	407	389
query50	828	393	402	393
query51	7586	7370	7092	7092
query52	99	89	89	89
query53	248	179	174	174
query54	520	392	389	389
query55	80	76	78	76
query56	252	234	233	233
query57	1259	1120	1119	1119
query58	211	205	202	202
query59	3153	3052	2944	2944
query60	265	232	252	232
query61	122	106	107	106
query62	773	674	669	669
query63	207	180	188	180
query64	1394	663	640	640
query65	3258	3153	3213	3153
query66	681	313	301	301
query67	15842	15754	15639	15639
query68	4208	567	556	556
query69	426	254	246	246
query70	1177	1121	1158	1121
query71	349	249	244	244
query72	6387	4039	4110	4039
query73	757	372	352	352
query74	10090	8999	8910	8910
query75	3374	2641	2703	2641
query76	1820	1068	1044	1044
query77	532	280	272	272
query78	10404	9515	9310	9310
query79	1711	586	585	585
query80	1030	425	440	425
query81	503	225	231	225
query82	1258	122	118	118
query83	160	160	140	140
query84	276	71	73	71
query85	862	310	308	308
query86	330	304	295	295
query87	4720	4633	4586	4586
query88	3572	2206	2169	2169
query89	423	297	290	290
query90	2003	183	185	183
query91	142	112	103	103
query92	67	57	50	50
query93	1949	546	548	546
query94	783	286	291	286
query95	343	249	248	248
query96	624	287	279	279
query97	2837	2719	2617	2617
query98	219	191	200	191
query99	1602	1347	1321	1321
Total cold run time: 319087 ms
Total hot run time: 196138 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.16 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9a27791a6d1ed9e666a2a82458a5eea683842ceb, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.23	0.07	0.07
query4	1.63	0.10	0.10
query5	0.43	0.42	0.42
query6	1.15	0.65	0.66
query7	0.02	0.01	0.01
query8	0.04	0.03	0.04
query9	0.56	0.50	0.49
query10	0.55	0.57	0.57
query11	0.15	0.10	0.09
query12	0.14	0.11	0.11
query13	0.60	0.59	0.60
query14	2.71	2.83	2.85
query15	0.92	0.82	0.81
query16	0.38	0.37	0.39
query17	1.07	1.02	1.06
query18	0.24	0.21	0.20
query19	1.87	1.79	1.96
query20	0.02	0.01	0.02
query21	15.36	0.58	0.58
query22	2.28	2.19	1.94
query23	17.08	1.00	0.78
query24	3.10	0.46	1.80
query25	0.28	0.17	0.10
query26	0.40	0.14	0.14
query27	0.03	0.03	0.04
query28	10.54	1.10	1.09
query29	12.56	3.30	3.26
query30	0.26	0.06	0.07
query31	2.86	0.38	0.36
query32	3.29	0.45	0.45
query33	2.96	3.02	3.09
query34	16.83	4.51	4.48
query35	4.50	4.49	4.42
query36	0.66	0.48	0.48
query37	0.10	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.02
query40	0.15	0.12	0.12
query41	0.07	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 106.27 s
Total hot run time: 32.16 s

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

1 similar comment
@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39705 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 0817c0f847b775bd0921d44cc14d71711aebeddf, data reload: false

------ Round 1 ----------------------------------
q1	17688	8203	7232	7232
q2	2051	179	163	163
q3	10581	1078	1290	1078
q4	10571	732	699	699
q5	7577	2691	2717	2691
q6	240	145	148	145
q7	977	624	604	604
q8	9252	1842	1885	1842
q9	6557	6463	6449	6449
q10	7005	2375	2309	2309
q11	469	255	246	246
q12	428	229	238	229
q13	17768	3028	3051	3028
q14	243	210	205	205
q15	557	531	527	527
q16	661	567	575	567
q17	966	500	520	500
q18	7132	6652	6670	6652
q19	1347	969	1004	969
q20	491	187	186	186
q21	4042	3369	3073	3073
q22	374	318	311	311
Total cold run time: 106977 ms
Total hot run time: 39705 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7217	7254	7403	7254
q2	326	226	237	226
q3	2890	2833	2889	2833
q4	2069	1848	1765	1765
q5	5713	5673	5587	5587
q6	226	138	140	138
q7	2285	1810	1805	1805
q8	3331	3549	3434	3434
q9	8852	9034	9037	9034
q10	3596	3546	3566	3546
q11	602	504	511	504
q12	832	594	614	594
q13	12236	3291	3200	3200
q14	303	256	274	256
q15	582	524	528	524
q16	685	627	650	627
q17	1871	1623	1617	1617
q18	8231	7794	7538	7538
q19	1698	1530	1566	1530
q20	2113	1882	1856	1856
q21	5576	5547	5539	5539
q22	644	540	564	540
Total cold run time: 71878 ms
Total hot run time: 59947 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196387 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 0817c0f847b775bd0921d44cc14d71711aebeddf, data reload: false

query1	1269	1016	944	944
query2	6256	2075	2031	2031
query3	11138	4699	4552	4552
query4	32694	23620	23313	23313
query5	3501	475	447	447
query6	269	189	187	187
query7	4001	309	306	306
query8	301	239	246	239
query9	9372	2704	2693	2693
query10	472	246	249	246
query11	17831	15395	15116	15116
query12	169	105	100	100
query13	1584	433	432	432
query14	9862	7437	7371	7371
query15	262	197	196	196
query16	8050	469	482	469
query17	1879	598	560	560
query18	2162	303	306	303
query19	378	153	146	146
query20	116	115	108	108
query21	194	105	106	105
query22	4828	4730	4656	4656
query23	34694	33792	33871	33792
query24	10322	2463	2535	2463
query25	608	386	408	386
query26	1181	148	150	148
query27	2332	296	287	287
query28	7031	2483	2445	2445
query29	840	413	414	413
query30	242	145	150	145
query31	1022	840	840	840
query32	95	55	59	55
query33	801	283	284	283
query34	1040	510	506	506
query35	893	747	756	747
query36	1121	972	982	972
query37	128	74	70	70
query38	4461	4305	4349	4305
query39	1490	1450	1440	1440
query40	212	98	96	96
query41	43	41	41	41
query42	109	103	103	103
query43	545	493	491	491
query44	1311	853	840	840
query45	191	168	169	168
query46	1188	700	692	692
query47	2024	1958	1906	1906
query48	421	327	322	322
query49	947	398	393	393
query50	834	392	397	392
query51	7522	7158	7214	7158
query52	107	88	87	87
query53	257	186	182	182
query54	1337	402	424	402
query55	83	80	87	80
query56	259	235	244	235
query57	1283	1160	1128	1128
query58	225	208	195	195
query59	3269	3003	3147	3003
query60	280	248	246	246
query61	147	99	110	99
query62	881	662	676	662
query63	215	184	183	183
query64	3836	683	647	647
query65	3265	3196	3151	3151
query66	839	296	298	296
query67	16220	15650	15738	15650
query68	4928	558	561	558
query69	441	245	254	245
query70	1188	1144	1145	1144
query71	336	247	264	247
query72	6312	4043	4100	4043
query73	753	360	360	360
query74	10368	8837	8779	8779
query75	3378	2652	2675	2652
query76	2692	1032	1155	1032
query77	366	273	273	273
query78	10319	9434	9464	9434
query79	2496	589	609	589
query80	1207	417	423	417
query81	546	242	226	226
query82	887	114	122	114
query83	242	137	137	137
query84	232	67	74	67
query85	1526	311	304	304
query86	472	295	301	295
query87	4594	4509	4483	4483
query88	4099	2236	2173	2173
query89	422	294	289	289
query90	2158	185	184	184
query91	145	104	113	104
query92	64	51	51	51
query93	2245	558	563	558
query94	1003	284	294	284
query95	352	251	283	251
query96	624	273	276	273
query97	2836	2706	2649	2649
query98	219	201	192	192
query99	1586	1315	1322	1315
Total cold run time: 301775 ms
Total hot run time: 196387 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.24 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0817c0f847b775bd0921d44cc14d71711aebeddf, data reload: false

query1	0.03	0.03	0.03
query2	0.08	0.04	0.04
query3	0.24	0.07	0.07
query4	1.62	0.11	0.11
query5	0.43	0.43	0.40
query6	1.14	0.64	0.66
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.57	0.53	0.50
query10	0.54	0.60	0.56
query11	0.14	0.10	0.11
query12	0.14	0.11	0.10
query13	0.61	0.60	0.60
query14	2.75	2.82	2.72
query15	0.89	0.84	0.83
query16	0.38	0.39	0.40
query17	0.99	1.01	1.07
query18	0.22	0.21	0.21
query19	1.94	1.88	2.05
query20	0.01	0.01	0.01
query21	15.38	0.60	0.60
query22	2.92	2.47	1.92
query23	16.92	0.75	0.84
query24	2.78	0.78	0.46
query25	0.26	0.23	0.07
query26	0.25	0.13	0.13
query27	0.06	0.04	0.06
query28	11.86	1.08	1.07
query29	12.57	3.23	3.23
query30	0.24	0.06	0.06
query31	2.86	0.38	0.39
query32	3.27	0.47	0.46
query33	2.98	3.02	3.03
query34	17.07	4.56	4.50
query35	4.59	4.53	4.58
query36	0.67	0.48	0.49
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.02
query40	0.16	0.12	0.13
query41	0.07	0.02	0.03
query42	0.04	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 107.93 s
Total hot run time: 32.24 s

@morrySnow
Copy link
Contributor

run p0

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

return castStringLikeLiteral(first, trimImpl(first.getValue(), " ", false, true));
}

/**
* Executable arithmetic functions rtrim
*/
@ExecFunction(name = "rtrim")
public static Expression rtrimVarcharVarchar(StringLikeLiteral first, StringLikeLiteral second) {
public static Expression rtrimVarchar(StringLikeLiteral first, StringLikeLiteral second) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove signature in name? and give it a meaningless name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because Signature in name is included by StringLikeLiteral, we need this signature before to indicate it is VarcharLiteral or StringLiteral. But now we can use StringlikeLiteral to include them all. Keep one in function to indicate the difference between rtrim and rtrimVarchar

englefly
englefly previously approved these changes Dec 18, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 18, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

@morrySnow morrySnow requested a review from aytrack January 2, 2025 09:09
@doris-robot
Copy link

TPC-H: Total hot run time: 32472 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit ecb9b0750ed02dbdd01e182d5e0fd8c9962e75ca, data reload: false

------ Round 1 ----------------------------------
q1	17646	6202	5995	5995
q2	2040	299	169	169
q3	10418	1238	703	703
q4	10209	865	442	442
q5	7522	2177	1984	1984
q6	204	181	150	150
q7	900	730	630	630
q8	9235	1359	1152	1152
q9	5187	4891	4925	4891
q10	6794	2283	1863	1863
q11	475	281	258	258
q12	351	353	222	222
q13	17773	3558	2912	2912
q14	240	244	207	207
q15	563	499	510	499
q16	618	621	575	575
q17	564	854	332	332
q18	7165	6430	6419	6419
q19	1657	952	559	559
q20	304	319	186	186
q21	2864	2234	2016	2016
q22	358	317	308	308
Total cold run time: 103087 ms
Total hot run time: 32472 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6225	6207	6182	6182
q2	235	330	235	235
q3	2223	2601	2352	2352
q4	1373	1793	1367	1367
q5	4327	4759	4718	4718
q6	193	182	146	146
q7	2115	1959	1830	1830
q8	2572	2764	2695	2695
q9	7299	7237	7159	7159
q10	3042	3322	2810	2810
q11	592	509	498	498
q12	642	747	592	592
q13	3370	3690	3117	3117
q14	290	303	295	295
q15	573	505	515	505
q16	678	689	649	649
q17	1175	1728	1246	1246
q18	7697	7445	7268	7268
q19	758	1029	1064	1029
q20	1945	2023	1858	1858
q21	5476	5121	4871	4871
q22	597	569	534	534
Total cold run time: 53397 ms
Total hot run time: 51956 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 189907 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit ecb9b0750ed02dbdd01e182d5e0fd8c9962e75ca, data reload: false

query1	953	372	375	372
query2	6528	2502	2376	2376
query3	6734	213	216	213
query4	33390	23846	23387	23387
query5	4397	620	455	455
query6	302	194	177	177
query7	4624	489	305	305
query8	303	243	234	234
query9	9466	2639	2618	2618
query10	469	317	244	244
query11	17910	15312	15563	15312
query12	159	109	103	103
query13	1658	531	390	390
query14	10560	7358	6767	6767
query15	243	202	199	199
query16	8040	594	402	402
query17	1595	742	570	570
query18	2096	400	303	303
query19	272	179	148	148
query20	120	114	113	113
query21	209	121	98	98
query22	4648	4679	4525	4525
query23	34252	33942	33373	33373
query24	6383	2312	2250	2250
query25	465	431	372	372
query26	1151	266	145	145
query27	2016	449	335	335
query28	5322	2429	2419	2419
query29	602	535	413	413
query30	226	181	146	146
query31	978	879	815	815
query32	79	58	91	58
query33	513	342	307	307
query34	742	827	501	501
query35	791	834	722	722
query36	1023	1027	936	936
query37	113	98	77	77
query38	4091	4136	4337	4136
query39	1498	1436	1437	1436
query40	203	111	98	98
query41	47	43	44	43
query42	119	105	102	102
query43	532	534	508	508
query44	1272	805	794	794
query45	180	180	167	167
query46	851	1037	645	645
query47	1902	1970	1880	1880
query48	380	404	314	314
query49	790	484	390	390
query50	621	654	391	391
query51	7211	7238	6942	6942
query52	102	98	92	92
query53	222	248	193	193
query54	463	489	411	411
query55	82	81	77	77
query56	247	270	244	244
query57	1200	1222	1088	1088
query58	239	226	235	226
query59	3150	3219	3130	3130
query60	274	254	259	254
query61	111	111	110	110
query62	872	796	742	742
query63	226	188	193	188
query64	4478	1017	649	649
query65	3271	3183	3225	3183
query66	1017	410	318	318
query67	15951	15809	15539	15539
query68	8267	702	522	522
query69	471	284	265	265
query70	1159	1177	1114	1114
query71	418	324	255	255
query72	6100	3839	3833	3833
query73	648	756	353	353
query74	10096	9061	8870	8870
query75	4530	3142	2615	2615
query76	4151	1196	804	804
query77	766	377	279	279
query78	10647	10170	9504	9504
query79	3910	812	583	583
query80	725	548	423	423
query81	476	281	229	229
query82	545	159	131	131
query83	205	166	148	148
query84	290	94	76	76
query85	762	368	306	306
query86	354	329	301	301
query87	4471	4647	4363	4363
query88	4144	2173	2123	2123
query89	425	322	314	314
query90	1948	190	188	188
query91	130	139	105	105
query92	63	56	53	53
query93	1397	789	538	538
query94	662	396	285	285
query95	344	267	251	251
query96	481	610	277	277
query97	2688	2807	2674	2674
query98	221	210	200	200
query99	1691	1587	1455	1455
Total cold run time: 294119 ms
Total hot run time: 189907 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.86 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit ecb9b0750ed02dbdd01e182d5e0fd8c9962e75ca, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.07
query4	1.62	0.10	0.10
query5	0.44	0.42	0.40
query6	1.17	0.64	0.65
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.58	0.50	0.49
query10	0.54	0.55	0.55
query11	0.14	0.10	0.10
query12	0.14	0.11	0.11
query13	0.61	0.60	0.60
query14	2.72	2.76	2.70
query15	0.89	0.83	0.81
query16	0.38	0.38	0.37
query17	1.08	1.07	1.07
query18	0.22	0.22	0.21
query19	1.84	1.75	1.90
query20	0.02	0.01	0.01
query21	15.36	0.91	0.60
query22	0.76	0.72	0.63
query23	15.34	1.42	0.51
query24	3.81	0.81	1.57
query25	0.15	0.18	0.14
query26	0.20	0.13	0.13
query27	0.05	0.07	0.06
query28	14.33	1.50	1.05
query29	12.56	3.93	3.23
query30	0.25	0.10	0.06
query31	2.82	0.58	0.39
query32	3.22	0.54	0.45
query33	3.06	3.03	3.12
query34	16.68	5.05	4.44
query35	4.48	4.46	4.48
query36	0.62	0.50	0.49
query37	0.10	0.07	0.05
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.16	0.14	0.13
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.03	0.04	0.03
Total cold run time: 106.95 s
Total hot run time: 30.86 s

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 32871 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 8be928e1c947ba4ed2a462777e02759fd81cf405, data reload: false

------ Round 1 ----------------------------------
q1	17580	6166	6084	6084
q2	2051	294	166	166
q3	10456	1282	751	751
q4	10274	860	430	430
q5	8843	2200	2003	2003
q6	211	183	147	147
q7	905	738	606	606
q8	9251	1343	1139	1139
q9	5232	4937	4956	4937
q10	6793	2308	1886	1886
q11	474	281	256	256
q12	346	359	227	227
q13	17763	3670	3149	3149
q14	232	233	210	210
q15	574	505	503	503
q16	609	617	584	584
q17	565	846	331	331
q18	6846	6435	6418	6418
q19	2139	971	563	563
q20	298	318	185	185
q21	2782	2144	1981	1981
q22	359	329	315	315
Total cold run time: 104583 ms
Total hot run time: 32871 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6365	6582	6284	6284
q2	237	321	239	239
q3	2228	2675	2324	2324
q4	1384	1847	1345	1345
q5	4344	4821	4897	4821
q6	188	178	141	141
q7	2065	1975	1838	1838
q8	2657	2779	2709	2709
q9	7315	7252	7362	7252
q10	3088	3381	2791	2791
q11	577	500	501	500
q12	650	788	641	641
q13	3517	3834	3226	3226
q14	300	300	295	295
q15	562	517	496	496
q16	655	692	668	668
q17	1226	1729	1231	1231
q18	7711	7377	7327	7327
q19	822	1029	1165	1029
q20	2063	2056	1949	1949
q21	5689	5255	4867	4867
q22	623	660	629	629
Total cold run time: 54266 ms
Total hot run time: 52602 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196664 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 8be928e1c947ba4ed2a462777e02759fd81cf405, data reload: false

query1	1309	975	897	897
query2	6455	2392	2284	2284
query3	11079	4814	4820	4814
query4	33014	23777	23453	23453
query5	3711	604	465	465
query6	270	185	175	175
query7	4007	483	305	305
query8	292	236	225	225
query9	9482	2633	2622	2622
query10	462	311	276	276
query11	18147	15299	15345	15299
query12	157	103	105	103
query13	1585	530	401	401
query14	9355	6826	6656	6656
query15	244	224	229	224
query16	8263	650	484	484
query17	1599	784	601	601
query18	2127	420	340	340
query19	207	195	173	173
query20	123	121	112	112
query21	210	132	112	112
query22	4567	4705	4406	4406
query23	34566	34042	33873	33873
query24	7424	2328	2272	2272
query25	469	454	400	400
query26	737	294	156	156
query27	2798	467	331	331
query28	5555	2461	2431	2431
query29	635	543	428	428
query30	213	182	146	146
query31	991	947	839	839
query32	86	58	58	58
query33	473	363	316	316
query34	736	852	517	517
query35	783	807	766	766
query36	1017	1074	970	970
query37	122	101	78	78
query38	4155	4345	4090	4090
query39	1594	1510	1464	1464
query40	198	116	101	101
query41	51	45	48	45
query42	119	102	98	98
query43	525	526	489	489
query44	1357	826	815	815
query45	185	174	169	169
query46	892	1070	644	644
query47	2026	2065	1943	1943
query48	406	420	311	311
query49	709	462	374	374
query50	657	706	392	392
query51	7229	7265	7177	7177
query52	99	99	94	94
query53	227	257	187	187
query54	471	500	407	407
query55	82	80	81	80
query56	267	271	248	248
query57	1267	1264	1202	1202
query58	238	225	222	222
query59	3181	3216	3211	3211
query60	289	266	260	260
query61	108	109	119	109
query62	855	829	755	755
query63	226	184	189	184
query64	3240	1031	660	660
query65	3406	3264	3232	3232
query66	816	405	301	301
query67	16299	15957	15617	15617
query68	8802	702	528	528
query69	477	289	250	250
query70	1192	1094	1105	1094
query71	425	283	250	250
query72	6334	3863	3795	3795
query73	642	744	345	345
query74	10139	9071	9307	9071
query75	3943	3146	2624	2624
query76	3600	1189	776	776
query77	746	365	276	276
query78	10216	10067	9584	9584
query79	2998	805	598	598
query80	643	502	433	433
query81	512	265	238	238
query82	428	146	123	123
query83	193	159	141	141
query84	278	91	69	69
query85	780	360	297	297
query86	399	313	300	300
query87	4452	4408	4329	4329
query88	4486	2153	2138	2138
query89	408	336	289	289
query90	1767	183	182	182
query91	131	139	107	107
query92	67	54	52	52
query93	2013	879	532	532
query94	635	379	292	292
query95	343	262	252	252
query96	482	603	288	288
query97	2997	2954	2878	2878
query98	226	210	197	197
query99	1645	1568	1447	1447
Total cold run time: 296843 ms
Total hot run time: 196664 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.33 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 8be928e1c947ba4ed2a462777e02759fd81cf405, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.03	0.03
query3	0.24	0.07	0.07
query4	1.61	0.11	0.10
query5	0.43	0.41	0.43
query6	1.15	0.66	0.65
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.60	0.50	0.50
query10	0.55	0.56	0.55
query11	0.14	0.10	0.11
query12	0.14	0.11	0.11
query13	0.62	0.60	0.60
query14	2.70	2.76	2.83
query15	0.90	0.82	0.83
query16	0.38	0.39	0.38
query17	1.05	1.00	0.99
query18	0.24	0.22	0.23
query19	1.87	1.87	1.99
query20	0.02	0.02	0.01
query21	15.35	0.92	0.57
query22	0.75	0.76	0.62
query23	15.30	1.40	0.58
query24	3.01	0.92	1.15
query25	0.23	0.13	0.04
query26	0.23	0.14	0.13
query27	0.05	0.06	0.06
query28	13.72	1.54	1.05
query29	12.57	3.95	3.32
query30	0.25	0.10	0.06
query31	2.83	0.58	0.36
query32	3.23	0.54	0.46
query33	3.02	3.06	3.08
query34	16.57	5.20	4.51
query35	4.60	4.52	4.60
query36	0.66	0.50	0.48
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.02	0.03
query40	0.17	0.14	0.14
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.04
Total cold run time: 105.69 s
Total hot run time: 31.33 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 6, 2025

PR approved by at least one committer and no changes requested.

@LiBinfeng-01
Copy link
Collaborator Author

run cloud_p0

Copy link

@aytrack aytrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morrySnow morrySnow merged commit 438a9cd into apache:master Jan 7, 2025
24 of 26 checks passed
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Jan 7, 2025
…re cases (apache#45233)

Issue Number: apache#44666
Related PR: apache#40441

Problem Summary:
- select substring_index('哈哈哈AAA','A', 1);
String.split function has second parameter 'limit', which is default
zero. When 'limit' is zero, it means it would remove trailing
empty strings split of '哈哈哈AAA', which would be '哈哈哈' only. But what we
expect is '哈哈哈', '','','' when part function is used by substring index.
So we should change splitpart limit to -1 to enable trailing empty
character in splitpart list
- reorganize fold constant of string functions in fe and add more cases
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Jan 7, 2025
…re cases (apache#45233)

Issue Number: apache#44666
Related PR: apache#40441

Problem Summary:
- select substring_index('哈哈哈AAA','A', 1);
String.split function has second parameter 'limit', which is default
zero. When 'limit' is zero, it means it would remove trailing
empty strings split of '哈哈哈AAA', which would be '哈哈哈' only. But what we
expect is '哈哈哈', '','','' when part function is used by substring index.
So we should change splitpart limit to -1 to enable trailing empty
character in splitpart list
- reorganize fold constant of string functions in fe and add more cases
morrySnow pushed a commit that referenced this pull request Jan 9, 2025
…re cases (#45233) (#46525)

pick: #45233 

Issue Number: #44666
Related PR: #40441

Problem Summary:
- select substring_index('哈哈哈AAA','A', 1); String.split function has
second parameter 'limit', which is default zero. When 'limit' is zero,
it means it would remove trailing empty strings split of '哈哈哈AAA', which
would be '哈哈哈' only. But what we expect is '哈哈哈', '','','' when part
function is used by substring index. So we should change splitpart limit
to -1 to enable trailing empty character in splitpart list
- reorganize fold constant of string functions in fe and add more cases

---------

Co-authored-by: Mryange <[email protected]>
morrySnow pushed a commit that referenced this pull request Jan 9, 2025
…s and add more cases #45233 (#46523)

pick: #45233
Issue Number: #44666
Related PR: #40441

Problem Summary:
- select substring_index('哈哈哈AAA','A', 1); String.split function has
second parameter 'limit', which is default zero. When 'limit' is zero,
it means it would remove trailing empty strings split of '哈哈哈AAA', which
would be '哈哈哈' only. But what we expect is '哈哈哈', '','','' when part
function is used by substring index. So we should change splitpart limit
to -1 to enable trailing empty character in splitpart list
- reorganize fold constant of string functions in fe and add more cases

---------

Co-authored-by: Mryange <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.1.8-merged dev/3.0.4-merged p0_w reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] upgrading from 2.1.2->2.1.7 causes query result error
5 participants