Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Feb 28, 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).

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 Feb 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 yujun777 changed the title [draft](nereids) add rule for non-foldable add project [draft](nereids) non-foldable expression add project Feb 28, 2025
@yujun777 yujun777 marked this pull request as draft March 11, 2025 02:20
@yujun777 yujun777 force-pushed the nonfoldable-add-project branch 2 times, most recently from 1a14013 to 3e77ec9 Compare August 13, 2025 06:44
@yujun777 yujun777 closed this Sep 1, 2025
@yujun777 yujun777 force-pushed the nonfoldable-add-project branch from 3e77ec9 to 3d89334 Compare September 1, 2025 03:48
@yujun777 yujun777 changed the title [draft](nereids) non-foldable expression add project [feat](unique function) add project for unique function Sep 1, 2025
@yujun777 yujun777 reopened this Sep 1, 2025
@yujun777 yujun777 marked this pull request as ready for review September 1, 2025 04:05
@yujun777
Copy link
Contributor Author

yujun777 commented Sep 1, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18011	5214	5071	5071
q2	2009	341	220	220
q3	10217	1291	741	741
q4	10240	1049	516	516
q5	7569	2389	2348	2348
q6	194	169	137	137
q7	929	753	641	641
q8	9343	1309	1129	1129
q9	6968	5174	5166	5166
q10	6938	2381	2016	2016
q11	521	306	288	288
q12	352	359	228	228
q13	17804	3655	3049	3049
q14	244	240	231	231
q15	577	508	485	485
q16	431	425	386	386
q17	592	880	373	373
q18	7450	7250	7132	7132
q19	1438	945	568	568
q20	338	340	240	240
q21	3780	3217	2319	2319
q22	1087	1053	1013	1013
Total cold run time: 107032 ms
Total hot run time: 34297 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5307	5148	5100	5100
q2	258	349	231	231
q3	2145	2681	2286	2286
q4	1352	1764	1307	1307
q5	4212	4367	4526	4367
q6	222	173	134	134
q7	2125	1991	1890	1890
q8	2681	2559	2564	2559
q9	7360	7392	7367	7367
q10	3159	3295	2951	2951
q11	612	508	493	493
q12	677	797	656	656
q13	3768	3893	3288	3288
q14	306	301	279	279
q15	537	485	486	485
q16	494	485	451	451
q17	1176	1614	1382	1382
q18	7831	7620	7601	7601
q19	843	800	884	800
q20	2021	2023	1799	1799
q21	4718	4367	4378	4367
q22	1099	1079	1053	1053
Total cold run time: 52903 ms
Total hot run time: 50846 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 46ca7f3ca2080b4368b0290a65fdbfb235ffc6e8, data reload: false

query1	1097	432	421	421
query2	6589	1777	1775	1775
query3	6758	231	224	224
query4	26266	23821	23245	23245
query5	4427	628	552	552
query6	362	249	235	235
query7	4658	529	306	306
query8	312	273	266	266
query9	8676	2933	2890	2890
query10	513	371	303	303
query11	15399	15045	14913	14913
query12	185	133	122	122
query13	1683	579	440	440
query14	9592	5867	5870	5867
query15	232	189	169	169
query16	7668	646	464	464
query17	1386	739	613	613
query18	2055	506	335	335
query19	203	200	176	176
query20	139	124	124	124
query21	217	128	124	124
query22	4150	4319	4069	4069
query23	34164	33214	33053	33053
query24	8119	2388	2397	2388
query25	556	533	442	442
query26	1228	279	170	170
query27	2726	513	356	356
query28	4360	2295	2262	2262
query29	782	603	501	501
query30	293	223	199	199
query31	932	792	755	755
query32	89	82	87	82
query33	589	383	352	352
query34	787	853	523	523
query35	836	830	746	746
query36	988	1023	939	939
query37	126	107	91	91
query38	4089	4007	4104	4007
query39	1493	1428	1452	1428
query40	230	133	121	121
query41	63	62	64	62
query42	129	120	130	120
query43	554	526	481	481
query44	1339	866	861	861
query45	181	180	166	166
query46	854	1021	654	654
query47	1787	1810	1764	1764
query48	382	442	315	315
query49	726	504	401	401
query50	647	682	400	400
query51	4126	4170	4113	4113
query52	122	119	106	106
query53	269	261	203	203
query54	614	602	549	549
query55	101	91	91	91
query56	341	330	326	326
query57	1176	1241	1153	1153
query58	293	290	278	278
query59	2665	2739	2605	2605
query60	371	356	343	343
query61	162	161	165	161
query62	822	744	672	672
query63	236	200	228	200
query64	4452	1131	821	821
query65	4298	4183	4202	4183
query66	1099	445	346	346
query67	15328	15053	15078	15053
query68	7944	910	588	588
query69	476	327	305	305
query70	1211	1159	1094	1094
query71	473	350	326	326
query72	5826	4990	4988	4988
query73	670	615	356	356
query74	8930	8943	8906	8906
query75	3927	3070	2677	2677
query76	3537	1157	733	733
query77	801	407	331	331
query78	9519	9738	8888	8888
query79	2454	841	593	593
query80	628	588	509	509
query81	505	261	228	228
query82	207	140	177	140
query83	263	267	247	247
query84	265	110	95	95
query85	880	466	424	424
query86	390	319	327	319
query87	4271	4213	4195	4195
query88	3789	2257	2229	2229
query89	407	354	293	293
query90	1929	232	231	231
query91	161	169	136	136
query92	90	75	75	75
query93	1931	977	658	658
query94	647	418	328	328
query95	423	335	340	335
query96	494	582	282	282
query97	2597	2710	2580	2580
query98	246	224	213	213
query99	1351	1431	1326	1326
Total cold run time: 275333 ms
Total hot run time: 187103 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.10	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.11	0.11
query5	0.46	0.45	0.40
query6	1.20	0.63	0.68
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.60	0.53	0.53
query10	0.58	0.58	0.58
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.63	0.62	0.62
query14	0.80	0.84	0.82
query15	0.89	0.87	0.86
query16	0.39	0.45	0.38
query17	1.04	1.04	1.02
query18	0.22	0.20	0.20
query19	1.89	1.88	1.80
query20	0.02	0.01	0.01
query21	15.40	0.97	0.60
query22	0.76	1.19	0.70
query23	14.93	1.37	0.64
query24	6.29	2.01	1.01
query25	0.49	0.23	0.21
query26	0.58	0.16	0.14
query27	0.06	0.06	0.06
query28	9.93	0.93	0.43
query29	12.56	3.91	3.22
query30	3.07	3.04	3.01
query31	2.82	0.57	0.39
query32	3.23	0.56	0.47
query33	3.02	3.09	3.09
query34	16.11	5.46	4.90
query35	4.92	4.85	4.92
query36	0.67	0.52	0.51
query37	0.10	0.07	0.07
query38	0.06	0.05	0.04
query39	0.03	0.04	0.03
query40	0.18	0.16	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 106.51 s
Total hot run time: 33.03 s

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 91.47% (118/129) 🎉
Increment coverage report
Complete coverage report

@yujun777
Copy link
Contributor Author

yujun777 commented Sep 1, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17627	5326	5019	5019
q2	2009	332	201	201
q3	10253	1286	701	701
q4	10228	1041	516	516
q5	7514	2402	2344	2344
q6	184	174	142	142
q7	916	744	635	635
q8	9354	1332	1093	1093
q9	6951	5164	5255	5164
q10	6940	2385	1970	1970
q11	496	309	282	282
q12	348	361	224	224
q13	17772	3606	3011	3011
q14	249	239	224	224
q15	567	499	482	482
q16	429	427	384	384
q17	591	876	361	361
q18	7434	7209	7179	7179
q19	1488	954	563	563
q20	351	340	239	239
q21	3633	3170	2378	2378
q22	1090	1061	1023	1023
Total cold run time: 106424 ms
Total hot run time: 34135 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5171	5106	5119	5106
q2	259	342	228	228
q3	2163	2656	2269	2269
q4	1339	1772	1366	1366
q5	4203	4399	4528	4399
q6	224	176	142	142
q7	2142	1945	1818	1818
q8	2557	2611	2579	2579
q9	7282	7413	7298	7298
q10	3218	3311	2937	2937
q11	564	510	507	507
q12	688	858	662	662
q13	3521	3954	3346	3346
q14	285	293	279	279
q15	523	500	474	474
q16	443	489	492	489
q17	1153	1552	1439	1439
q18	7916	7750	7648	7648
q19	795	835	847	835
q20	1893	1938	1798	1798
q21	4764	4377	4311	4311
q22	1074	1046	1001	1001
Total cold run time: 52177 ms
Total hot run time: 50931 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186740 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 1271354004c8665faf80a8a2bea3db58aa2ad89e, data reload: false

query1	1100	415	408	408
query2	6570	1756	1784	1756
query3	6752	227	226	226
query4	26012	23495	22982	22982
query5	4371	643	526	526
query6	336	248	243	243
query7	4649	519	305	305
query8	312	260	268	260
query9	8577	2894	2897	2894
query10	508	362	295	295
query11	15746	14913	14732	14732
query12	182	123	129	123
query13	1690	558	449	449
query14	9520	5772	5778	5772
query15	211	191	182	182
query16	7706	685	482	482
query17	1250	750	641	641
query18	2060	450	408	408
query19	208	197	177	177
query20	139	132	136	132
query21	218	142	117	117
query22	4162	4331	4188	4188
query23	33797	33066	33051	33051
query24	8226	2341	2411	2341
query25	572	519	439	439
query26	1253	271	164	164
query27	2713	498	363	363
query28	4314	2260	2238	2238
query29	777	611	491	491
query30	300	227	199	199
query31	929	817	726	726
query32	86	79	84	79
query33	596	405	371	371
query34	790	874	520	520
query35	810	843	745	745
query36	951	1008	917	917
query37	131	110	90	90
query38	4150	4001	4110	4001
query39	1494	1415	1432	1415
query40	227	132	141	132
query41	66	62	60	60
query42	127	115	130	115
query43	530	491	466	466
query44	1319	866	860	860
query45	188	172	171	171
query46	857	1025	641	641
query47	1800	1820	1784	1784
query48	389	439	336	336
query49	762	505	413	413
query50	648	682	394	394
query51	4185	4126	4034	4034
query52	120	121	105	105
query53	251	276	206	206
query54	609	588	538	538
query55	96	98	86	86
query56	354	320	321	320
query57	1211	1203	1146	1146
query58	292	291	296	291
query59	2702	2821	2693	2693
query60	357	365	359	359
query61	165	159	167	159
query62	834	743	680	680
query63	236	196	190	190
query64	4484	1135	850	850
query65	4299	4223	4224	4223
query66	1107	449	353	353
query67	15628	15349	15104	15104
query68	9478	918	578	578
query69	492	339	294	294
query70	1263	1114	1112	1112
query71	469	353	304	304
query72	5579	4929	4947	4929
query73	811	580	355	355
query74	8888	9256	8944	8944
query75	4220	3093	2643	2643
query76	3760	1181	823	823
query77	882	419	335	335
query78	9499	9766	8896	8896
query79	2211	847	608	608
query80	683	572	517	517
query81	474	262	232	232
query82	244	144	112	112
query83	297	267	245	245
query84	304	114	90	90
query85	853	477	412	412
query86	348	313	319	313
query87	4266	4302	4243	4243
query88	2778	2218	2217	2217
query89	430	348	287	287
query90	2086	220	224	220
query91	162	157	137	137
query92	92	77	70	70
query93	1784	1015	647	647
query94	691	429	319	319
query95	410	336	322	322
query96	480	591	285	285
query97	2699	2691	2588	2588
query98	250	220	216	216
query99	1427	1437	1290	1290
Total cold run time: 276321 ms
Total hot run time: 186740 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 1271354004c8665faf80a8a2bea3db58aa2ad89e, data reload: false

query1	0.06	0.04	0.05
query2	0.10	0.06	0.06
query3	0.26	0.08	0.08
query4	1.61	0.12	0.12
query5	0.45	0.41	0.41
query6	1.18	0.63	0.66
query7	0.03	0.02	0.02
query8	0.06	0.05	0.05
query9	0.59	0.55	0.53
query10	0.58	0.59	0.59
query11	0.16	0.12	0.11
query12	0.14	0.12	0.12
query13	0.63	0.62	0.62
query14	0.80	0.83	0.85
query15	0.87	0.86	0.87
query16	0.38	0.43	0.41
query17	1.08	1.07	1.05
query18	0.21	0.21	0.20
query19	1.93	1.85	1.85
query20	0.02	0.01	0.02
query21	15.39	0.91	0.57
query22	0.80	1.24	0.70
query23	14.82	1.37	0.63
query24	6.63	1.48	0.36
query25	0.42	0.20	0.06
query26	0.59	0.15	0.13
query27	0.07	0.06	0.06
query28	9.79	0.91	0.42
query29	12.56	3.81	3.22
query30	3.09	3.00	2.95
query31	2.82	0.58	0.38
query32	3.24	0.55	0.48
query33	3.05	3.08	3.10
query34	15.98	5.52	4.87
query35	4.98	4.87	4.95
query36	0.70	0.53	0.50
query37	0.10	0.08	0.07
query38	0.06	0.05	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 106.6 s
Total hot run time: 32.24 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 50.36% (70/139) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 88.49% (123/139) 🎉
Increment coverage report
Complete coverage report

// extract unique function which exist multiple times from targets,
// then alias the unique function and put them into a child project,
// then rewrite targets with the alias names.
private <T extends Expression> Optional<Pair<List<T>, LogicalProject<Plan>>> rewriteExpressions(
Copy link
Contributor

Choose a reason for hiding this comment

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

add UT for these functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have added

// if a unique function exists multiple times in the targets, then add a project to alias it.
private List<NamedExpression> tryGenUniqueFunctionAlias(Collection<? extends Expression> targets) {
Map<UniqueFunction, Integer> unqiueFunctionCounter = Maps.newLinkedHashMap();
targets.forEach(target -> target.foreach(e -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

use for to instead forEach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix

@yujun777
Copy link
Contributor Author

yujun777 commented Sep 2, 2025

run buildall

1 similar comment
@yujun777
Copy link
Contributor Author

yujun777 commented Sep 2, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17618	5282	5159	5159
q2	1977	322	218	218
q3	10263	1298	753	753
q4	10264	1044	539	539
q5	7551	2410	2445	2410
q6	185	172	142	142
q7	956	759	661	661
q8	9355	1407	1172	1172
q9	7079	5186	5163	5163
q10	6966	2390	1981	1981
q11	506	306	289	289
q12	380	372	229	229
q13	17780	3665	3032	3032
q14	234	259	217	217
q15	577	512	502	502
q16	442	429	391	391
q17	609	901	371	371
q18	7497	7111	7013	7013
q19	1109	952	564	564
q20	358	352	231	231
q21	3962	3195	2387	2387
q22	1076	1034	1017	1017
Total cold run time: 106744 ms
Total hot run time: 34441 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5184	5170	5170	5170
q2	254	334	257	257
q3	2159	2680	2351	2351
q4	1445	1788	1325	1325
q5	4212	4453	4561	4453
q6	222	183	132	132
q7	2027	2112	1850	1850
q8	2582	2734	2588	2588
q9	7381	7369	7367	7367
q10	3091	3449	2855	2855
q11	573	529	520	520
q12	693	878	641	641
q13	3686	3870	3326	3326
q14	279	314	285	285
q15	548	477	492	477
q16	486	501	465	465
q17	1173	1621	1397	1397
q18	7906	7871	7576	7576
q19	816	846	853	846
q20	1988	2043	1866	1866
q21	4855	4460	4312	4312
q22	1075	1037	991	991
Total cold run time: 52635 ms
Total hot run time: 51050 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186731 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 6cd8006ae2e53814975f33d21afa2db7fcea62be, data reload: false

query1	1048	458	411	411
query2	6551	1794	1786	1786
query3	6756	232	224	224
query4	26319	23482	23212	23212
query5	4430	645	517	517
query6	342	252	239	239
query7	4658	536	302	302
query8	310	278	250	250
query9	8672	2926	2918	2918
query10	502	359	306	306
query11	15738	15190	14803	14803
query12	173	126	122	122
query13	1686	575	445	445
query14	9376	5777	5855	5777
query15	208	198	179	179
query16	7359	649	504	504
query17	1220	750	636	636
query18	2024	490	339	339
query19	213	207	170	170
query20	132	123	121	121
query21	219	136	113	113
query22	4036	4173	4077	4077
query23	34376	33090	32948	32948
query24	8265	2398	2407	2398
query25	585	522	442	442
query26	1239	280	171	171
query27	2721	513	364	364
query28	4382	2303	2268	2268
query29	806	623	524	524
query30	285	225	194	194
query31	924	815	696	696
query32	92	83	82	82
query33	582	392	359	359
query34	793	862	525	525
query35	814	835	772	772
query36	1003	1034	946	946
query37	122	113	95	95
query38	4092	4108	3948	3948
query39	1502	1439	1450	1439
query40	240	135	129	129
query41	65	65	61	61
query42	134	121	119	119
query43	572	511	483	483
query44	1367	860	864	860
query45	180	179	173	173
query46	868	1026	659	659
query47	1774	1828	1746	1746
query48	412	445	313	313
query49	751	512	406	406
query50	647	703	399	399
query51	4086	4109	4177	4109
query52	121	112	103	103
query53	261	265	201	201
query54	632	600	544	544
query55	106	103	96	96
query56	353	324	320	320
query57	1201	1244	1135	1135
query58	292	286	277	277
query59	2638	2820	2581	2581
query60	368	348	348	348
query61	168	202	177	177
query62	822	742	675	675
query63	232	194	196	194
query64	4508	1133	832	832
query65	4303	4223	4212	4212
query66	1169	452	363	363
query67	15542	15339	15137	15137
query68	7865	925	581	581
query69	492	338	293	293
query70	1200	1174	1147	1147
query71	549	345	385	345
query72	5842	4944	4905	4905
query73	659	585	360	360
query74	9279	8830	9007	8830
query75	3153	3126	2616	2616
query76	3130	1160	751	751
query77	517	509	343	343
query78	9427	9565	8954	8954
query79	2458	844	598	598
query80	635	576	511	511
query81	513	267	229	229
query82	484	145	111	111
query83	264	262	250	250
query84	258	113	87	87
query85	905	515	420	420
query86	390	320	294	294
query87	4277	4361	4190	4190
query88	3851	2217	2237	2217
query89	402	331	286	286
query90	1930	231	229	229
query91	154	184	138	138
query92	89	78	71	71
query93	1961	982	661	661
query94	752	441	318	318
query95	414	341	328	328
query96	482	587	286	286
query97	2614	2669	2578	2578
query98	267	226	219	219
query99	1336	1418	1311	1311
Total cold run time: 274916 ms
Total hot run time: 186731 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.04
query2	0.09	0.05	0.05
query3	0.25	0.09	0.09
query4	1.61	0.11	0.12
query5	0.47	0.44	0.43
query6	1.16	0.66	0.68
query7	0.03	0.03	0.02
query8	0.05	0.04	0.05
query9	0.60	0.54	0.51
query10	0.60	0.59	0.59
query11	0.16	0.11	0.12
query12	0.16	0.12	0.13
query13	0.64	0.62	0.62
query14	0.79	0.84	0.84
query15	0.88	0.88	0.85
query16	0.41	0.43	0.40
query17	1.08	1.08	1.06
query18	0.22	0.20	0.20
query19	1.95	1.83	1.84
query20	0.01	0.02	0.01
query21	15.39	0.97	0.58
query22	0.78	1.19	0.80
query23	14.81	1.38	0.61
query24	6.51	1.18	0.69
query25	0.51	0.16	0.08
query26	0.59	0.17	0.15
query27	0.07	0.05	0.05
query28	9.70	0.96	0.42
query29	12.59	3.88	3.20
query30	3.07	3.03	2.96
query31	2.83	0.60	0.40
query32	3.24	0.54	0.47
query33	3.02	3.07	3.00
query34	16.03	5.53	4.82
query35	4.93	4.90	4.88
query36	0.70	0.51	0.50
query37	0.11	0.07	0.07
query38	0.07	0.04	0.05
query39	0.03	0.02	0.03
query40	0.19	0.15	0.14
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.04
Total cold run time: 106.57 s
Total hot run time: 32.55 s

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 88.65% (125/141) 🎉
Increment coverage report
Complete coverage report

@yujun777 yujun777 force-pushed the nonfoldable-add-project branch from 6cd8006 to 4b43e8f Compare September 2, 2025 10:18
@yujun777
Copy link
Contributor Author

yujun777 commented Sep 2, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17622	5348	5139	5139
q2	1995	327	253	253
q3	10213	1316	748	748
q4	10223	1053	539	539
q5	7522	2442	2361	2361
q6	183	167	147	147
q7	946	789	630	630
q8	9346	1384	1134	1134
q9	7010	5150	5081	5081
q10	6889	2407	1991	1991
q11	501	337	281	281
q12	357	371	239	239
q13	17758	3670	3004	3004
q14	245	256	223	223
q15	545	507	479	479
q16	433	427	375	375
q17	590	859	371	371
q18	7770	6981	7095	6981
q19	1228	958	581	581
q20	350	345	237	237
q21	3936	3272	2401	2401
q22	1084	1014	975	975
Total cold run time: 106746 ms
Total hot run time: 34170 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5170	5175	5202	5175
q2	255	334	229	229
q3	2215	2678	2370	2370
q4	1419	1854	1337	1337
q5	4193	4479	4581	4479
q6	215	185	141	141
q7	2114	1984	1865	1865
q8	2703	2753	2762	2753
q9	7304	7231	7479	7231
q10	3106	3208	2905	2905
q11	619	523	537	523
q12	701	902	683	683
q13	3574	3906	3421	3421
q14	453	303	283	283
q15	515	495	500	495
q16	513	496	468	468
q17	1179	1590	1440	1440
q18	7887	7616	7615	7615
q19	854	907	1098	907
q20	1993	2059	1925	1925
q21	5153	4698	4636	4636
q22	1081	1050	1010	1010
Total cold run time: 53216 ms
Total hot run time: 51891 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187515 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 4b43e8f6a08e55003fd74aaf834bb91af0cccb0c, data reload: false

query1	1077	432	412	412
query2	6568	1795	1742	1742
query3	6766	236	231	231
query4	26538	23780	23236	23236
query5	4346	646	537	537
query6	332	243	255	243
query7	4656	547	303	303
query8	291	252	244	244
query9	8683	2949	2945	2945
query10	468	374	286	286
query11	15879	15217	14883	14883
query12	172	118	117	117
query13	1672	583	436	436
query14	8650	5908	5819	5819
query15	219	191	168	168
query16	7148	701	514	514
query17	1021	785	653	653
query18	2026	451	376	376
query19	213	199	174	174
query20	132	127	128	127
query21	221	129	116	116
query22	4013	4188	3967	3967
query23	33728	32921	33035	32921
query24	8206	2403	2415	2403
query25	593	538	435	435
query26	1258	285	175	175
query27	2729	526	376	376
query28	4393	2319	2297	2297
query29	803	620	495	495
query30	294	233	199	199
query31	909	801	774	774
query32	89	84	84	84
query33	589	391	372	372
query34	815	867	533	533
query35	821	837	758	758
query36	987	1034	938	938
query37	130	120	95	95
query38	4055	3997	4021	3997
query39	1509	1448	1452	1448
query40	236	171	134	134
query41	67	64	61	61
query42	131	121	123	121
query43	556	530	502	502
query44	1371	886	876	876
query45	188	179	172	172
query46	913	1042	664	664
query47	1739	1787	1744	1744
query48	403	438	326	326
query49	770	534	409	409
query50	653	696	405	405
query51	4228	4210	4161	4161
query52	121	124	111	111
query53	253	275	212	212
query54	629	617	539	539
query55	97	108	99	99
query56	349	340	330	330
query57	1205	1182	1132	1132
query58	293	307	283	283
query59	2720	2742	2551	2551
query60	376	355	362	355
query61	203	190	191	190
query62	823	737	682	682
query63	239	213	200	200
query64	4615	1274	947	947
query65	4322	4269	4218	4218
query66	1188	466	375	375
query67	15512	15300	14966	14966
query68	7964	955	592	592
query69	512	341	364	341
query70	1251	1158	1150	1150
query71	577	364	333	333
query72	5957	5039	5125	5039
query73	726	658	367	367
query74	8937	8956	9071	8956
query75	3790	3121	2654	2654
query76	3666	1175	786	786
query77	813	419	407	407
query78	9631	9729	8842	8842
query79	2168	851	600	600
query80	660	591	527	527
query81	491	263	230	230
query82	436	142	113	113
query83	259	268	259	259
query84	302	119	92	92
query85	931	472	421	421
query86	345	335	290	290
query87	4267	4232	4200	4200
query88	3225	2306	2244	2244
query89	416	359	295	295
query90	1925	234	234	234
query91	166	166	138	138
query92	97	78	76	76
query93	1176	1022	659	659
query94	700	443	317	317
query95	416	341	328	328
query96	499	599	287	287
query97	2661	2682	2601	2601
query98	259	216	222	216
query99	1458	1476	1327	1327
Total cold run time: 273880 ms
Total hot run time: 187515 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.04
query2	0.10	0.05	0.06
query3	0.25	0.08	0.08
query4	1.61	0.12	0.12
query5	0.46	0.42	0.41
query6	1.17	0.65	0.66
query7	0.03	0.03	0.03
query8	0.06	0.04	0.04
query9	0.60	0.54	0.51
query10	0.57	0.60	0.58
query11	0.17	0.11	0.11
query12	0.15	0.12	0.12
query13	0.63	0.62	0.62
query14	0.80	0.85	0.82
query15	0.87	0.89	0.85
query16	0.39	0.41	0.39
query17	1.04	1.06	1.05
query18	0.21	0.20	0.20
query19	1.93	1.80	1.77
query20	0.02	0.01	0.02
query21	15.39	0.94	0.57
query22	0.81	1.17	0.69
query23	14.91	1.36	0.59
query24	6.84	1.06	1.37
query25	0.49	0.25	0.09
query26	0.55	0.16	0.13
query27	0.08	0.05	0.06
query28	10.31	0.92	0.43
query29	12.63	3.89	3.23
query30	3.11	3.06	2.97
query31	2.83	0.57	0.38
query32	3.23	0.55	0.47
query33	3.11	3.22	3.16
query34	16.10	5.44	4.84
query35	4.91	4.93	4.92
query36	0.70	0.52	0.50
query37	0.11	0.07	0.08
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.04	0.02
query43	0.05	0.04	0.03
Total cold run time: 107.68 s
Total hot run time: 32.9 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 70.86% (124/175) 🎉
Increment coverage report
Complete coverage report

@yujun777
Copy link
Contributor Author

yujun777 commented Sep 3, 2025

run external

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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 Sep 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 22eb680 into apache:master Sep 5, 2025
26 of 28 checks passed
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