Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Aug 28, 2025

What problem does this PR solve?

in logical plan builder, there are bugs with between:

  • for sql a between random() and random(), since the two unbound 'random() are the same, it will rewrite to a = random(), but the two random() should be different after bind expression;
  • for sql random() between 0.1 and 0.5, it will rewrite to random() >= 0.1 and random() <= 0.5, later when bind expression, the two unbound random() will generate two different bounded random() function, but the two random() need to be the same.

so, in logical plan builder, the between shouldn't compare low bound and upper bound, and should not expand before bind expression.

relate PR:

  1. unique function: [feat](unique function) Add unique function #54414
  2. remove between: [opt](Nereids) remove between expression to simplify planner #23421

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

@Thearas
Copy link
Contributor

Thearas commented Aug 28, 2025

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?

@yujun777
Copy link
Contributor Author

run buildall

4 similar comments
@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17619	5205	5080	5080
q2	2007	325	211	211
q3	10258	1252	695	695
q4	10223	1025	515	515
q5	7498	2409	2421	2409
q6	184	170	135	135
q7	914	767	635	635
q8	9343	1348	1100	1100
q9	6959	5033	5114	5033
q10	6933	2372	1986	1986
q11	505	296	296	296
q12	350	350	214	214
q13	17806	3604	3035	3035
q14	239	237	229	229
q15	588	508	495	495
q16	433	426	389	389
q17	600	853	376	376
q18	7488	7117	7072	7072
q19	1307	958	557	557
q20	327	339	223	223
q21	3783	3234	3111	3111
q22	1136	1056	1007	1007
Total cold run time: 106500 ms
Total hot run time: 34803 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5203	5104	5076	5076
q2	249	326	227	227
q3	2141	2664	2320	2320
q4	1386	1739	1282	1282
q5	4214	4343	4602	4343
q6	230	188	140	140
q7	2004	1932	1912	1912
q8	2651	2691	2565	2565
q9	7332	7324	7258	7258
q10	3164	3277	2904	2904
q11	584	568	516	516
q12	684	789	642	642
q13	3527	3858	3380	3380
q14	317	304	273	273
q15	512	498	482	482
q16	444	491	441	441
q17	1195	1602	1389	1389
q18	7797	7826	7378	7378
q19	815	845	855	845
q20	2004	2077	1916	1916
q21	4877	4298	4306	4298
q22	1094	1033	1050	1033
Total cold run time: 52424 ms
Total hot run time: 50620 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187196 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 56e92b40e0a1d86ef5c1d9399ad77915375dcad3, data reload: false

query1	1071	438	423	423
query2	6559	1771	1738	1738
query3	6752	234	226	226
query4	26000	23594	23201	23201
query5	4393	629	521	521
query6	330	249	252	249
query7	4640	513	303	303
query8	318	274	251	251
query9	8651	2905	2904	2904
query10	460	347	283	283
query11	15748	15369	14778	14778
query12	182	127	131	127
query13	1707	573	450	450
query14	9598	5934	5901	5901
query15	219	190	177	177
query16	7686	685	492	492
query17	1259	770	649	649
query18	2066	484	332	332
query19	207	197	184	184
query20	132	123	125	123
query21	220	132	117	117
query22	4110	4203	3977	3977
query23	33677	32966	32829	32829
query24	8153	2404	2406	2404
query25	600	506	454	454
query26	1253	271	170	170
query27	2689	516	353	353
query28	4324	2265	2247	2247
query29	774	610	516	516
query30	295	228	195	195
query31	925	796	723	723
query32	89	81	82	81
query33	572	439	355	355
query34	797	862	514	514
query35	865	818	778	778
query36	985	1004	937	937
query37	119	110	91	91
query38	4080	4072	3990	3990
query39	1459	1448	1424	1424
query40	233	135	128	128
query41	71	66	62	62
query42	124	116	122	116
query43	531	501	481	481
query44	1351	881	867	867
query45	181	177	177	177
query46	867	1039	655	655
query47	1794	1783	1724	1724
query48	399	422	347	347
query49	739	501	421	421
query50	648	688	415	415
query51	4196	4095	4075	4075
query52	114	114	106	106
query53	245	266	203	203
query54	643	599	543	543
query55	95	93	89	89
query56	349	335	334	334
query57	1181	1206	1145	1145
query58	299	288	284	284
query59	2701	2665	2665	2665
query60	364	360	349	349
query61	168	164	162	162
query62	826	727	672	672
query63	235	197	198	197
query64	4447	1158	876	876
query65	4321	4215	4243	4215
query66	1115	454	393	393
query67	15153	15303	14845	14845
query68	9101	931	595	595
query69	496	334	294	294
query70	1219	1201	1173	1173
query71	486	359	331	331
query72	5942	5103	5348	5103
query73	762	656	366	366
query74	8988	9191	9008	9008
query75	4204	3126	2695	2695
query76	3624	1192	768	768
query77	834	422	335	335
query78	9664	9790	8875	8875
query79	2504	810	614	614
query80	721	580	531	531
query81	481	276	236	236
query82	432	150	111	111
query83	306	268	254	254
query84	302	116	95	95
query85	890	467	482	467
query86	345	336	315	315
query87	4324	4301	4258	4258
query88	3151	2256	2236	2236
query89	413	340	306	306
query90	1961	240	232	232
query91	171	181	136	136
query92	98	79	74	74
query93	1472	1004	677	677
query94	717	417	326	326
query95	415	346	338	338
query96	494	583	277	277
query97	2710	2724	2596	2596
query98	253	228	213	213
query99	1501	1425	1348	1348
Total cold run time: 276335 ms
Total hot run time: 187196 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.25	0.08	0.09
query4	1.60	0.12	0.12
query5	0.45	0.44	0.42
query6	1.21	0.64	0.67
query7	0.03	0.03	0.02
query8	0.05	0.04	0.05
query9	0.61	0.53	0.53
query10	0.58	0.58	0.59
query11	0.17	0.11	0.12
query12	0.15	0.12	0.13
query13	0.63	0.63	0.62
query14	0.81	0.87	0.84
query15	0.87	0.88	0.86
query16	0.39	0.40	0.40
query17	1.06	1.02	1.06
query18	0.22	0.20	0.20
query19	1.91	1.82	1.77
query20	0.01	0.02	0.01
query21	15.41	0.97	0.61
query22	0.79	1.09	0.65
query23	15.06	1.40	0.63
query24	6.75	1.13	0.91
query25	0.48	0.24	0.19
query26	0.65	0.15	0.13
query27	0.06	0.06	0.07
query28	9.90	1.00	0.43
query29	12.62	4.09	3.34
query30	3.11	3.06	2.97
query31	2.83	0.60	0.40
query32	3.25	0.56	0.48
query33	3.04	3.11	3.15
query34	16.12	5.42	4.80
query35	5.00	4.96	4.91
query36	0.70	0.52	0.49
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.04
query40	0.19	0.15	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 107.48 s
Total hot run time: 32.97 s

@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17648	5256	5066	5066
q2	1991	352	213	213
q3	10225	1290	734	734
q4	10240	1027	549	549
q5	7514	2442	2346	2346
q6	196	178	143	143
q7	940	780	634	634
q8	9364	1352	1175	1175
q9	6912	5144	5207	5144
q10	6929	2390	2013	2013
q11	503	313	280	280
q12	350	361	224	224
q13	17761	3629	3039	3039
q14	234	237	223	223
q15	570	518	509	509
q16	444	430	378	378
q17	591	863	364	364
q18	7386	7186	7237	7186
q19	1112	992	593	593
q20	355	345	225	225
q21	3727	2585	2352	2352
q22	1066	1016	1000	1000
Total cold run time: 106058 ms
Total hot run time: 34390 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5148	5172	5189	5172
q2	253	332	233	233
q3	2231	2736	2296	2296
q4	1388	1782	1346	1346
q5	4217	4413	4671	4413
q6	271	194	133	133
q7	2093	1953	1825	1825
q8	2665	2628	2597	2597
q9	7384	7296	7387	7296
q10	3107	3291	2868	2868
q11	592	509	525	509
q12	699	767	655	655
q13	3518	3995	3344	3344
q14	281	311	297	297
q15	537	501	496	496
q16	491	536	474	474
q17	1209	1555	1414	1414
q18	7964	7582	7743	7582
q19	819	879	848	848
q20	2059	2136	1914	1914
q21	5031	4747	4225	4225
q22	1073	1046	1028	1028
Total cold run time: 53030 ms
Total hot run time: 50965 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187413 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 0543fe2db55f1269b4d3ecfe1bf13632874e8806, data reload: false

query1	1060	442	441	441
query2	6557	1759	1803	1759
query3	6758	240	227	227
query4	26292	23600	23276	23276
query5	4369	625	519	519
query6	343	242	223	223
query7	4637	509	306	306
query8	304	270	248	248
query9	8649	2889	2899	2889
query10	470	366	312	312
query11	15922	15085	14850	14850
query12	175	122	119	119
query13	1673	553	421	421
query14	9580	5859	5813	5813
query15	211	196	183	183
query16	7550	691	510	510
query17	1249	774	661	661
query18	2051	449	347	347
query19	219	206	185	185
query20	136	128	126	126
query21	216	137	117	117
query22	4098	4293	4097	4097
query23	34107	33071	33086	33071
query24	8240	2394	2386	2386
query25	573	548	442	442
query26	1242	295	167	167
query27	2715	508	361	361
query28	4373	2311	2216	2216
query29	762	606	500	500
query30	295	223	208	208
query31	902	777	731	731
query32	96	77	82	77
query33	569	407	358	358
query34	804	861	523	523
query35	810	851	773	773
query36	969	1025	937	937
query37	131	139	91	91
query38	4162	4050	3992	3992
query39	1518	1461	1450	1450
query40	227	134	129	129
query41	73	64	64	64
query42	129	113	118	113
query43	535	534	483	483
query44	1357	870	863	863
query45	184	179	175	175
query46	877	1030	670	670
query47	1801	1824	1785	1785
query48	386	422	318	318
query49	761	518	421	421
query50	649	699	398	398
query51	4116	4252	4126	4126
query52	129	113	109	109
query53	249	262	204	204
query54	617	602	541	541
query55	95	91	89	89
query56	345	340	319	319
query57	1194	1228	1135	1135
query58	295	288	284	284
query59	2652	2740	2623	2623
query60	365	360	344	344
query61	166	176	161	161
query62	826	763	674	674
query63	230	201	194	194
query64	4434	1169	910	910
query65	4312	4212	4229	4212
query66	1138	450	354	354
query67	15679	15219	15038	15038
query68	7906	923	585	585
query69	473	328	305	305
query70	1225	1158	1146	1146
query71	478	365	326	326
query72	5794	4929	5014	4929
query73	685	616	365	365
query74	9103	9171	8970	8970
query75	3851	3110	2618	2618
query76	3644	1291	770	770
query77	802	443	334	334
query78	9524	9761	8935	8935
query79	2211	820	594	594
query80	646	581	530	530
query81	486	261	229	229
query82	426	143	116	116
query83	252	263	317	263
query84	250	108	92	92
query85	888	453	425	425
query86	350	318	318	318
query87	4279	4347	4195	4195
query88	3278	2269	2216	2216
query89	405	335	297	297
query90	1938	234	233	233
query91	163	165	134	134
query92	89	81	69	69
query93	1161	976	676	676
query94	710	431	339	339
query95	416	333	325	325
query96	493	579	282	282
query97	2703	2702	2627	2627
query98	253	225	229	225
query99	1469	1394	1297	1297
Total cold run time: 274959 ms
Total hot run time: 187413 ms

@doris-robot
Copy link

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

query1	0.06	0.04	0.04
query2	0.09	0.05	0.06
query3	0.26	0.09	0.08
query4	1.61	0.12	0.12
query5	0.45	0.42	0.43
query6	1.17	0.64	0.66
query7	0.03	0.03	0.03
query8	0.06	0.05	0.05
query9	0.61	0.55	0.52
query10	0.58	0.58	0.59
query11	0.17	0.12	0.11
query12	0.15	0.12	0.13
query13	0.63	0.63	0.62
query14	0.79	0.84	0.86
query15	0.89	0.87	0.87
query16	0.39	0.42	0.41
query17	1.04	1.05	1.07
query18	0.25	0.20	0.20
query19	1.91	1.83	1.84
query20	0.02	0.01	0.02
query21	15.41	1.00	0.58
query22	0.77	1.18	0.77
query23	14.85	1.41	0.66
query24	6.37	1.77	0.34
query25	0.42	0.12	0.07
query26	0.51	0.17	0.14
query27	0.05	0.06	0.05
query28	10.00	0.99	0.44
query29	12.62	3.91	3.20
query30	3.04	3.09	3.03
query31	2.84	0.60	0.39
query32	3.24	0.57	0.48
query33	3.08	3.10	3.08
query34	16.07	5.46	4.84
query35	4.93	4.99	4.94
query36	0.72	0.51	0.51
query37	0.11	0.08	0.07
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.19	0.15	0.15
query41	0.09	0.04	0.03
query42	0.03	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 106.64 s
Total hot run time: 32.49 s

@yujun777
Copy link
Contributor Author

run p0

2 similar comments
@yujun777
Copy link
Contributor Author

run p0

@yujun777
Copy link
Contributor Author

run p0

@yujun777
Copy link
Contributor Author

run buildall

@yujun777 yujun777 force-pushed the add-between-back-2 branch from e9ea359 to c469e06 Compare August 29, 2025 11:05
@yujun777 yujun777 force-pushed the add-between-back-2 branch from c469e06 to c97458f Compare August 29, 2025 11:20
@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17633	5300	5148	5148
q2	1992	320	215	215
q3	10248	1298	756	756
q4	10244	1015	566	566
q5	7541	2458	2365	2365
q6	192	169	145	145
q7	933	793	625	625
q8	9343	1339	1129	1129
q9	7065	5172	5092	5092
q10	6955	2398	1999	1999
q11	516	303	276	276
q12	359	356	229	229
q13	17808	3727	3085	3085
q14	250	242	228	228
q15	566	518	487	487
q16	444	431	390	390
q17	599	879	365	365
q18	7541	7172	7130	7130
q19	1092	960	575	575
q20	361	344	239	239
q21	3962	3190	2408	2408
q22	1090	1025	975	975
Total cold run time: 106734 ms
Total hot run time: 34427 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5234	5183	5193	5183
q2	253	330	225	225
q3	2205	2727	2334	2334
q4	1411	1845	1359	1359
q5	4259	4568	4720	4568
q6	242	178	133	133
q7	2123	2009	1878	1878
q8	2707	2587	2682	2587
q9	7432	7311	7314	7311
q10	3135	3373	2917	2917
q11	645	540	520	520
q12	728	873	800	800
q13	3498	3905	3453	3453
q14	302	312	284	284
q15	543	497	489	489
q16	472	530	457	457
q17	1238	1573	1542	1542
q18	7967	7779	7601	7601
q19	860	820	928	820
q20	2073	2098	1990	1990
q21	5109	4932	4614	4614
q22	1085	1033	1004	1004
Total cold run time: 53521 ms
Total hot run time: 52069 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187103 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 c97458f1cfd44c716a1fb882c6148b435f0aa06a, data reload: false

query1	1054	465	408	408
query2	6587	1816	1820	1816
query3	6754	228	224	224
query4	26185	23616	22917	22917
query5	4806	687	543	543
query6	340	261	237	237
query7	4663	533	312	312
query8	311	274	271	271
query9	8703	2921	2923	2921
query10	534	385	317	317
query11	16210	14981	14803	14803
query12	187	121	121	121
query13	1662	554	432	432
query14	10877	5989	5830	5830
query15	222	200	172	172
query16	7668	700	507	507
query17	1594	761	627	627
query18	2032	437	367	367
query19	205	200	174	174
query20	152	129	122	122
query21	222	130	113	113
query22	4021	4122	3969	3969
query23	34090	33134	32895	32895
query24	7875	2423	2394	2394
query25	586	522	442	442
query26	1244	284	173	173
query27	2713	517	354	354
query28	4360	2284	2284	2284
query29	811	642	499	499
query30	299	233	205	205
query31	922	830	699	699
query32	91	80	84	80
query33	578	401	405	401
query34	805	882	545	545
query35	858	833	768	768
query36	1005	1034	913	913
query37	129	115	90	90
query38	4015	4109	4119	4109
query39	1486	1425	1409	1409
query40	226	139	132	132
query41	67	64	64	64
query42	133	116	120	116
query43	556	517	492	492
query44	1391	877	856	856
query45	184	179	169	169
query46	868	1033	662	662
query47	1749	1813	1725	1725
query48	403	442	327	327
query49	755	537	412	412
query50	655	676	404	404
query51	4159	4149	4187	4149
query52	121	115	106	106
query53	259	280	214	214
query54	625	617	545	545
query55	101	96	92	92
query56	410	344	341	341
query57	1195	1207	1134	1134
query58	289	292	286	286
query59	2692	2783	2633	2633
query60	368	350	354	350
query61	164	159	159	159
query62	834	775	688	688
query63	241	196	199	196
query64	4412	1131	857	857
query65	4368	4213	4270	4213
query66	1094	446	342	342
query67	15519	15384	15207	15207
query68	5746	964	595	595
query69	488	344	322	322
query70	1185	1180	1159	1159
query71	451	347	325	325
query72	5904	5040	4935	4935
query73	661	600	362	362
query74	9337	9183	8929	8929
query75	3157	3089	2647	2647
query76	3226	1147	760	760
query77	516	440	344	344
query78	9523	9611	8843	8843
query79	2199	853	600	600
query80	1245	597	608	597
query81	540	266	237	237
query82	392	149	115	115
query83	267	267	245	245
query84	265	111	94	94
query85	867	470	438	438
query86	410	342	312	312
query87	4259	4275	4238	4238
query88	2909	2239	2255	2239
query89	406	327	316	316
query90	1834	243	239	239
query91	166	225	130	130
query92	92	76	73	73
query93	1566	1006	666	666
query94	770	430	297	297
query95	412	336	320	320
query96	503	603	285	285
query97	2605	2735	2557	2557
query98	242	217	216	216
query99	1364	1425	1334	1334
Total cold run time: 274201 ms
Total hot run time: 187103 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.06	0.06
query3	0.25	0.09	0.08
query4	1.61	0.11	0.12
query5	0.45	0.44	0.41
query6	1.18	0.65	0.66
query7	0.03	0.03	0.03
query8	0.06	0.05	0.05
query9	0.62	0.55	0.53
query10	0.58	0.60	0.57
query11	0.17	0.11	0.11
query12	0.15	0.13	0.13
query13	0.62	0.64	0.62
query14	0.82	0.89	0.83
query15	0.88	0.91	0.86
query16	0.39	0.41	0.39
query17	1.08	1.08	1.07
query18	0.22	0.20	0.22
query19	1.93	1.84	1.89
query20	0.02	0.01	0.01
query21	15.41	0.92	0.58
query22	0.75	1.13	0.78
query23	14.84	1.42	0.63
query24	6.91	1.51	1.00
query25	0.50	0.14	0.19
query26	0.62	0.16	0.13
query27	0.05	0.05	0.06
query28	10.10	0.93	0.44
query29	12.59	3.89	3.22
query30	3.12	3.08	2.99
query31	2.84	0.59	0.39
query32	3.25	0.56	0.47
query33	3.01	3.16	3.13
query34	16.15	5.44	4.84
query35	4.94	4.91	4.96
query36	0.70	0.53	0.49
query37	0.10	0.07	0.07
query38	0.05	0.05	0.04
query39	0.04	0.03	0.04
query40	0.20	0.14	0.15
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 107.54 s
Total hot run time: 33.16 s

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 85.71% (24/28) 🎉
Increment coverage report
Complete coverage report

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

github-actions bot commented Sep 1, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

PR approved by anyone and no changes requested.

@924060929 924060929 merged commit 525deed into apache:master Sep 1, 2025
26 of 28 checks passed
morrySnow pushed a commit that referenced this pull request Sep 5, 2025
### What problem does this PR solve?

If an unique function exists multiple times, then be will calculate it
multiple times for each row, so it will be error.

for example: `filter(random() between 10 and 20)`, after rewrite the
`between`, it will get `filter(random() >= 10 and random() <= 20)`, this
will contains two random in one expression, the two RANDOM should be
one, so we add a project, then we can get `filter(k >= 10 and k <= 20)
-> project(random() as k)`

this PR also fix BETWEEN expression bug introduced by #55407
- between shouldn't be PropagateNullable because FoldConstantRuleOnFE
will rewrite a propagate nullable expression to null if any children is
NULL, but for sql `10 between null and 5` should be `FALSE`, not `NULL`;
- after analyzed between expression, it will get an AND expression, then
anlyzed join other conjunctions, need to extract conjuncts of each
analyzed other conjunction (that is flattern AND).
wenzhenghu pushed a commit to wenzhenghu/doris that referenced this pull request Sep 8, 2025
### What problem does this PR solve?

If an unique function exists multiple times, then be will calculate it
multiple times for each row, so it will be error.

for example: `filter(random() between 10 and 20)`, after rewrite the
`between`, it will get `filter(random() >= 10 and random() <= 20)`, this
will contains two random in one expression, the two RANDOM should be
one, so we add a project, then we can get `filter(k >= 10 and k <= 20)
-> project(random() as k)`

this PR also fix BETWEEN expression bug introduced by apache#55407
- between shouldn't be PropagateNullable because FoldConstantRuleOnFE
will rewrite a propagate nullable expression to null if any children is
NULL, but for sql `10 between null and 5` should be `FALSE`, not `NULL`;
- after analyzed between expression, it will get an AND expression, then
anlyzed join other conjunctions, need to extract conjuncts of each
analyzed other conjunction (that is flattern AND).
feiniaofeiafei pushed a commit to feiniaofeiafei/doris that referenced this pull request Jan 20, 2026
…`betweenAnd` expression class and included some work related to unique functions. This time, the pick only included the changes related to `betweenAnd`.
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants