Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Aug 26, 2025

What problem does this PR solve?

For alias(slotReference as slotReference), can replace with slotReference directly.

For example, for sql select first_value(b) over() from t,

Before this pr, it will have:

LogicalProject[26] ( distinct=false, projects=[first_value(b) over()#2 AS first_value(b) over()#2] )
    |
LogicalWindow

With this pr, it will have:

LogicalProject[26] ( distinct=false, projects=[first_value(b) over()#2] )
   |
LogicalWindow

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

@hello-stephen
Copy link
Contributor

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

924060929
924060929 previously approved these changes Aug 26, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 26, 2025
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17584	5219	5195	5195
q2	1936	315	183	183
q3	10288	1304	698	698
q4	10221	1009	522	522
q5	7470	2407	2328	2328
q6	179	157	127	127
q7	889	738	593	593
q8	9320	1339	1048	1048
q9	6862	5134	5211	5134
q10	6865	2395	1960	1960
q11	495	290	259	259
q12	339	346	220	220
q13	17769	3614	2997	2997
q14	229	236	221	221
q15	547	485	485	485
q16	429	424	365	365
q17	617	867	355	355
q18	7616	7174	7123	7123
q19	1228	1082	558	558
q20	347	339	227	227
q21	3726	2566	2316	2316
q22	1064	1041	960	960
Total cold run time: 106020 ms
Total hot run time: 33874 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5154	5127	5125	5125
q2	241	327	221	221
q3	2136	2677	2324	2324
q4	1351	1772	1362	1362
q5	4182	4443	4644	4443
q6	211	172	130	130
q7	2042	1991	1785	1785
q8	2636	2664	2659	2659
q9	7451	7369	7277	7277
q10	3098	3271	2832	2832
q11	575	513	479	479
q12	701	751	640	640
q13	3534	4064	3227	3227
q14	280	313	262	262
q15	509	477	481	477
q16	473	542	447	447
q17	1236	1608	1416	1416
q18	7897	7526	7545	7526
q19	876	831	884	831
q20	2018	2053	1919	1919
q21	5143	4285	4353	4285
q22	1094	1026	990	990
Total cold run time: 52838 ms
Total hot run time: 50657 ms

@morrySnow morrySnow added usercase Important user case type label dev/2.1.x dev/3.0.x dev/3.1.x labels Aug 26, 2025
@doris-robot
Copy link

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

query1	1006	415	418	415
query2	6531	1724	1726	1724
query3	6752	226	227	226
query4	26069	23254	22841	22841
query5	4354	642	493	493
query6	328	221	209	209
query7	4635	510	290	290
query8	290	226	214	214
query9	8590	2875	2876	2875
query10	466	338	298	298
query11	15806	15254	14656	14656
query12	164	117	114	114
query13	1660	557	424	424
query14	8764	5742	5675	5675
query15	220	194	179	179
query16	7241	599	493	493
query17	1183	713	563	563
query18	1973	410	310	310
query19	214	185	154	154
query20	123	120	114	114
query21	209	119	101	101
query22	4205	4219	4137	4137
query23	33817	32704	32708	32704
query24	8007	2327	2359	2327
query25	545	465	409	409
query26	1219	275	163	163
query27	2750	511	352	352
query28	4420	2275	2243	2243
query29	795	555	461	461
query30	291	224	189	189
query31	877	802	699	699
query32	86	76	77	76
query33	569	379	335	335
query34	788	838	506	506
query35	812	809	775	775
query36	974	1018	920	920
query37	151	105	83	83
query38	4063	4057	4049	4049
query39	1471	1429	1407	1407
query40	228	124	112	112
query41	57	57	53	53
query42	118	109	110	109
query43	494	504	482	482
query44	1330	890	862	862
query45	175	173	165	165
query46	849	1006	649	649
query47	1811	1837	1736	1736
query48	387	426	317	317
query49	722	500	386	386
query50	646	701	388	388
query51	4047	4269	4109	4109
query52	110	111	103	103
query53	237	255	186	186
query54	587	593	533	533
query55	87	84	86	84
query56	319	334	318	318
query57	1202	1175	1112	1112
query58	274	276	274	274
query59	2671	2734	2578	2578
query60	342	337	338	337
query61	127	125	124	124
query62	773	727	634	634
query63	225	188	186	186
query64	4437	1071	788	788
query65	4306	4188	4203	4188
query66	1163	442	344	344
query67	15698	15342	15029	15029
query68	8115	910	575	575
query69	488	321	293	293
query70	1244	1155	1140	1140
query71	463	343	305	305
query72	5573	4729	4796	4729
query73	719	635	359	359
query74	8960	9236	8863	8863
query75	3715	3073	2743	2743
query76	3708	1132	735	735
query77	806	419	326	326
query78	9547	9693	8832	8832
query79	2385	798	598	598
query80	627	533	533	533
query81	470	255	223	223
query82	436	145	109	109
query83	274	261	233	233
query84	292	153	85	85
query85	793	370	327	327
query86	344	301	290	290
query87	4258	4320	4146	4146
query88	3142	2208	2183	2183
query89	381	319	285	285
query90	1930	220	219	219
query91	141	140	113	113
query92	92	69	72	69
query93	1557	1007	646	646
query94	680	411	307	307
query95	391	306	302	302
query96	492	568	273	273
query97	2675	2714	2568	2568
query98	246	233	218	218
query99	1429	1386	1291	1291
Total cold run time: 272213 ms
Total hot run time: 184307 ms

@yujun777 yujun777 changed the title [fix](nereids) fix window expression reuse expr id [fix](nereids) fix window expression alias reuse expr id Aug 26, 2025
@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.09	0.05	0.04
query3	0.25	0.08	0.07
query4	1.61	0.11	0.11
query5	0.42	0.43	0.41
query6	1.19	0.64	0.65
query7	0.03	0.02	0.02
query8	0.05	0.04	0.03
query9	0.61	0.52	0.51
query10	0.58	0.58	0.59
query11	0.16	0.12	0.11
query12	0.15	0.11	0.12
query13	0.63	0.60	0.62
query14	0.79	0.86	0.83
query15	0.87	0.84	0.85
query16	0.38	0.40	0.39
query17	1.07	1.05	1.03
query18	0.21	0.20	0.19
query19	1.87	1.90	1.86
query20	0.01	0.01	0.02
query21	15.42	0.95	0.57
query22	0.79	1.29	0.90
query23	14.77	1.40	0.61
query24	6.32	1.07	1.05
query25	0.48	0.14	0.17
query26	0.52	0.17	0.14
query27	0.07	0.06	0.06
query28	10.00	0.99	0.43
query29	12.56	3.93	3.23
query30	3.05	2.99	2.92
query31	2.83	0.62	0.39
query32	3.24	0.55	0.48
query33	3.12	3.03	3.09
query34	16.17	5.46	4.85
query35	4.87	4.96	4.92
query36	0.71	0.51	0.50
query37	0.10	0.07	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.19	0.15	0.15
query41	0.08	0.03	0.03
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 106.44 s
Total hot run time: 32.99 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (5/5) 🎉
Increment coverage report
Complete coverage report

morrySnow
morrySnow previously approved these changes Aug 26, 2025
@yujun777 yujun777 dismissed stale reviews from morrySnow and 924060929 via 59d0017 August 28, 2025 06:48
@yujun777 yujun777 force-pushed the fix-normalize-to-slot branch from f38d3f2 to 59d0017 Compare August 28, 2025 06:48
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Aug 28, 2025
@yujun777 yujun777 force-pushed the fix-normalize-to-slot branch from 59d0017 to c9e56e8 Compare August 28, 2025 06:50
@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17648	5244	5099	5099
q2	2034	316	212	212
q3	10250	1255	699	699
q4	10218	1012	519	519
q5	7536	2479	2270	2270
q6	192	175	145	145
q7	916	760	646	646
q8	9353	1319	1088	1088
q9	6916	5075	5227	5075
q10	6933	2399	1943	1943
q11	497	300	274	274
q12	375	351	219	219
q13	17788	3657	3009	3009
q14	240	261	220	220
q15	581	501	482	482
q16	425	433	381	381
q17	592	862	354	354
q18	7482	7097	7098	7097
q19	1345	972	551	551
q20	363	357	227	227
q21	3690	2541	2362	2362
q22	1068	1009	986	986
Total cold run time: 106442 ms
Total hot run time: 33858 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5214	5108	5131	5108
q2	261	326	231	231
q3	2182	2665	2282	2282
q4	1380	1758	1346	1346
q5	4190	4257	4541	4257
q6	210	171	135	135
q7	2183	1974	1879	1879
q8	2699	2643	2608	2608
q9	7344	7493	7294	7294
q10	3084	3332	2865	2865
q11	592	540	519	519
q12	688	782	628	628
q13	3524	3900	3395	3395
q14	285	317	302	302
q15	540	486	489	486
q16	455	473	468	468
q17	1283	1584	1420	1420
q18	7851	7723	7387	7387
q19	817	892	1101	892
q20	2042	2035	1900	1900
q21	4752	4444	4255	4255
q22	1064	1036	1014	1014
Total cold run time: 52640 ms
Total hot run time: 50671 ms

@doris-robot
Copy link

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

query1	1046	448	437	437
query2	6566	1750	1809	1750
query3	6761	234	235	234
query4	26342	23701	23245	23245
query5	4453	639	522	522
query6	347	251	216	216
query7	4655	498	304	304
query8	307	259	244	244
query9	8658	2880	2875	2875
query10	498	342	298	298
query11	15879	15264	15343	15264
query12	181	134	133	133
query13	1688	608	453	453
query14	9715	5984	5972	5972
query15	244	200	183	183
query16	7512	670	478	478
query17	1219	778	637	637
query18	2040	428	338	338
query19	203	197	178	178
query20	136	126	126	126
query21	227	126	114	114
query22	3970	4200	4105	4105
query23	33805	32759	33041	32759
query24	8089	2395	2347	2347
query25	576	521	441	441
query26	1237	279	169	169
query27	2724	510	364	364
query28	4344	2259	2222	2222
query29	789	650	532	532
query30	303	242	213	213
query31	924	812	730	730
query32	93	93	85	85
query33	586	414	370	370
query34	832	839	524	524
query35	847	839	751	751
query36	993	1033	927	927
query37	126	115	90	90
query38	4095	4012	3979	3979
query39	1500	1449	1438	1438
query40	225	137	129	129
query41	71	65	64	64
query42	131	117	125	117
query43	529	508	480	480
query44	1379	874	862	862
query45	183	176	177	176
query46	882	1012	645	645
query47	1763	1806	1755	1755
query48	391	428	334	334
query49	731	513	419	419
query50	643	707	401	401
query51	4120	4144	4054	4054
query52	124	116	107	107
query53	254	263	203	203
query54	617	597	542	542
query55	99	92	90	90
query56	340	337	337	337
query57	1229	1193	1132	1132
query58	288	291	283	283
query59	2674	2761	2581	2581
query60	359	364	345	345
query61	184	163	154	154
query62	816	759	703	703
query63	242	207	205	205
query64	4609	1238	968	968
query65	4271	4189	4206	4189
query66	1167	465	421	421
query67	15398	15517	14949	14949
query68	8851	933	590	590
query69	484	321	309	309
query70	1275	1191	1162	1162
query71	485	356	319	319
query72	6032	4904	4966	4904
query73	751	634	370	370
query74	8997	8924	8925	8924
query75	4204	3099	2657	2657
query76	3731	1162	740	740
query77	801	414	356	356
query78	9473	9789	8750	8750
query79	3756	836	585	585
query80	702	588	534	534
query81	483	280	232	232
query82	574	147	113	113
query83	294	270	245	245
query84	302	120	95	95
query85	881	450	429	429
query86	353	331	293	293
query87	4330	4266	4132	4132
query88	2826	2308	2234	2234
query89	449	329	292	292
query90	1936	231	230	230
query91	178	169	136	136
query92	96	78	72	72
query93	2330	981	659	659
query94	694	421	334	334
query95	413	332	335	332
query96	482	599	280	280
query97	2671	2732	2559	2559
query98	258	303	218	218
query99	1504	1471	1318	1318
Total cold run time: 278825 ms
Total hot run time: 187095 ms

@yujun777
Copy link
Contributor Author

run p0

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.26	0.08	0.09
query4	1.60	0.11	0.12
query5	0.45	0.41	0.42
query6	1.17	0.64	0.68
query7	0.03	0.03	0.03
query8	0.06	0.05	0.05
query9	0.61	0.54	0.53
query10	0.59	0.59	0.58
query11	0.17	0.11	0.12
query12	0.16	0.12	0.12
query13	0.64	0.63	0.62
query14	0.81	0.84	0.86
query15	0.89	0.87	0.86
query16	0.39	0.40	0.41
query17	1.11	1.05	1.08
query18	0.21	0.20	0.20
query19	1.96	1.90	1.82
query20	0.01	0.01	0.01
query21	15.39	0.94	0.58
query22	0.77	1.21	0.65
query23	14.90	1.41	0.64
query24	6.76	1.40	1.13
query25	0.59	0.23	0.12
query26	0.61	0.16	0.15
query27	0.06	0.06	0.05
query28	9.79	0.96	0.44
query29	12.79	3.89	3.25
query30	3.08	3.07	3.12
query31	2.82	0.60	0.39
query32	3.25	0.57	0.47
query33	3.06	3.10	3.13
query34	16.02	5.54	4.85
query35	4.96	4.89	4.92
query36	0.71	0.52	0.49
query37	0.11	0.07	0.08
query38	0.05	0.05	0.04
query39	0.04	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.05	0.04	0.03
Total cold run time: 107.38 s
Total hot run time: 33.2 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (5/5) 🎉
Increment coverage report
Complete coverage report

@yujun777
Copy link
Contributor Author

run cloud_p0

@doris-robot
Copy link

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

query1	0.06	0.04	0.05
query2	0.09	0.05	0.06
query3	0.25	0.08	0.09
query4	1.61	0.11	0.12
query5	0.45	0.42	0.42
query6	1.18	0.64	0.68
query7	0.03	0.02	0.02
query8	0.06	0.05	0.04
query9	0.61	0.53	0.52
query10	0.58	0.57	0.58
query11	0.17	0.12	0.11
query12	0.16	0.13	0.12
query13	0.64	0.63	0.63
query14	0.78	0.84	0.83
query15	0.88	0.84	0.86
query16	0.39	0.41	0.41
query17	1.06	1.07	1.06
query18	0.24	0.21	0.21
query19	1.89	1.82	1.79
query20	0.01	0.02	0.01
query21	15.40	0.98	0.58
query22	0.77	1.22	0.91
query23	14.74	1.42	0.68
query24	6.93	2.52	0.41
query25	0.34	0.18	0.11
query26	0.64	0.17	0.13
query27	0.06	0.05	0.05
query28	9.89	0.96	0.43
query29	12.61	3.93	3.32
query30	3.14	3.00	2.94
query31	2.83	0.60	0.38
query32	3.22	0.55	0.48
query33	3.10	3.13	3.10
query34	16.11	5.45	4.92
query35	4.94	4.95	4.92
query36	0.72	0.55	0.51
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	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.13 s
Total hot run time: 32.75 s

@hello-stephen
Copy link
Contributor

FE Regression && UT Coverage Report

Increment line coverage 100.00% (5/5) 🎉
Increment coverage report
Complete coverage report

@yujun777
Copy link
Contributor Author

run p0

@yujun777
Copy link
Contributor Author

run nonConcurrent

@yujun777
Copy link
Contributor Author

run p0

1 similar comment
@yujun777
Copy link
Contributor Author

run p0

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (5/5) 🎉
Increment coverage report
Complete coverage report

@morrySnow morrySnow closed this Aug 29, 2025
@morrySnow morrySnow reopened this Aug 29, 2025
@morrySnow morrySnow merged commit 8706fc1 into apache:master Aug 29, 2025
38 of 39 checks passed
@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (5/5) 🎉
Increment coverage report
Complete coverage report

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.12-merged dev/3.1.1-merged reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants