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) let anonymous alias same as user input #47093

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morrySnow
Copy link
Contributor

@morrySnow morrySnow commented Jan 16, 2025

What problem does this PR solve?

Problem Summary:

use user input as alias if no explict alias for named expression

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. All named expression without alias will get a default alias from sql text
  • 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?

@morrySnow morrySnow added usercase Important user case type label dev/2.1.x dev/3.0.x labels Jan 16, 2025
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17580	5559	5443	5443
q2	2050	320	176	176
q3	10404	1224	762	762
q4	10247	998	523	523
q5	8436	2367	2145	2145
q6	196	166	134	134
q7	905	754	615	615
q8	9232	1392	1228	1228
q9	5116	4904	5015	4904
q10	6838	2346	1881	1881
q11	468	279	252	252
q12	347	356	213	213
q13	17786	3669	3585	3585
q14	229	230	220	220
q15	526	486	474	474
q16	626	630	601	601
q17	573	866	346	346
q18	7140	6662	6481	6481
q19	2204	976	567	567
q20	317	330	197	197
q21	2967	2253	2053	2053
q22	389	355	326	326
Total cold run time: 104576 ms
Total hot run time: 33126 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5619	5522	5581	5522
q2	247	333	242	242
q3	2312	2627	2369	2369
q4	1451	1801	1365	1365
q5	4315	4741	4740	4740
q6	179	165	130	130
q7	2100	2004	1805	1805
q8	2631	2820	2733	2733
q9	7378	7226	7278	7226
q10	3019	3268	2697	2697
q11	593	519	496	496
q12	735	820	679	679
q13	3586	4019	3337	3337
q14	288	312	268	268
q15	513	489	469	469
q16	663	693	659	659
q17	1236	1733	1275	1275
q18	7721	7596	7281	7281
q19	850	907	1163	907
q20	1969	2057	1900	1900
q21	5792	5268	4986	4986
q22	610	618	593	593
Total cold run time: 53807 ms
Total hot run time: 51679 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 194457 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 4064581a290b3f5d9014daae84e63689f76f7d72, data reload: false

query1	1310	1002	915	915
query2	6383	2082	1979	1979
query3	11093	4608	4624	4608
query4	60623	34240	23108	23108
query5	5587	623	444	444
query6	331	203	175	175
query7	5049	510	295	295
query8	307	232	216	216
query9	6325	2684	2666	2666
query10	430	335	256	256
query11	15552	15120	15472	15120
query12	161	111	105	105
query13	1010	564	420	420
query14	11447	6990	6937	6937
query15	212	204	198	198
query16	7267	678	543	543
query17	1128	754	581	581
query18	1944	429	315	315
query19	199	195	162	162
query20	112	110	113	110
query21	213	128	107	107
query22	4354	4709	4419	4419
query23	34278	33390	32890	32890
query24	5710	2319	2392	2319
query25	480	508	417	417
query26	637	290	165	165
query27	1719	482	334	334
query28	4083	2500	2457	2457
query29	564	563	427	427
query30	216	192	155	155
query31	896	858	798	798
query32	71	87	55	55
query33	426	382	285	285
query34	778	906	519	519
query35	822	868	779	779
query36	1066	1032	980	980
query37	133	104	85	85
query38	4372	4369	4362	4362
query39	1487	1474	1481	1474
query40	205	113	98	98
query41	55	51	50	50
query42	122	102	104	102
query43	512	522	486	486
query44	1381	850	841	841
query45	189	175	170	170
query46	914	1097	655	655
query47	1887	1907	1826	1826
query48	400	419	325	325
query49	702	495	429	429
query50	701	697	413	413
query51	6996	7013	6959	6959
query52	114	103	94	94
query53	255	268	192	192
query54	508	533	440	440
query55	87	90	84	84
query56	284	287	295	287
query57	1229	1216	1107	1107
query58	240	238	246	238
query59	3166	2974	2887	2887
query60	282	267	249	249
query61	115	116	114	114
query62	722	713	654	654
query63	223	186	187	186
query64	1244	1028	674	674
query65	3245	3166	3176	3166
query66	714	399	312	312
query67	15781	15651	15599	15599
query68	4939	851	534	534
query69	515	307	262	262
query70	1201	1158	1144	1144
query71	418	316	273	273
query72	5416	3882	3934	3882
query73	807	799	361	361
query74	10250	9068	8818	8818
query75	3281	3161	2662	2662
query76	3819	1260	807	807
query77	479	372	278	278
query78	10300	10328	9408	9408
query79	2433	769	621	621
query80	1726	636	442	442
query81	543	274	238	238
query82	347	154	123	123
query83	266	174	161	161
query84	289	102	76	76
query85	792	355	313	313
query86	395	316	302	302
query87	4414	4523	4581	4523
query88	3627	2208	2220	2208
query89	407	332	287	287
query90	1503	192	192	192
query91	137	144	111	111
query92	64	59	55	55
query93	2301	880	529	529
query94	690	435	291	291
query95	328	271	261	261
query96	500	679	288	288
query97	2852	2866	2732	2732
query98	236	198	201	198
query99	1293	1386	1260	1260
Total cold run time: 307616 ms
Total hot run time: 194457 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.07	0.04	0.03
query3	0.24	0.07	0.07
query4	1.61	0.10	0.10
query5	0.44	0.43	0.41
query6	1.14	0.65	0.65
query7	0.02	0.01	0.02
query8	0.04	0.02	0.03
query9	0.59	0.51	0.51
query10	0.56	0.56	0.55
query11	0.14	0.11	0.11
query12	0.14	0.11	0.12
query13	0.62	0.59	0.60
query14	2.73	2.87	2.74
query15	0.90	0.85	0.83
query16	0.38	0.39	0.37
query17	1.00	1.06	1.00
query18	0.22	0.21	0.21
query19	1.94	1.88	1.99
query20	0.02	0.02	0.01
query21	15.37	0.90	0.59
query22	0.74	0.80	0.67
query23	15.28	1.44	0.57
query24	3.18	0.81	1.73
query25	0.19	0.07	0.11
query26	0.32	0.15	0.14
query27	0.08	0.05	0.06
query28	13.86	1.00	0.44
query29	12.60	3.92	3.27
query30	0.25	0.09	0.06
query31	2.83	0.60	0.39
query32	3.23	0.55	0.45
query33	3.01	3.03	2.99
query34	16.87	5.19	4.56
query35	4.60	4.53	4.63
query36	0.66	0.52	0.48
query37	0.09	0.06	0.07
query38	0.05	0.04	0.03
query39	0.03	0.02	0.03
query40	0.16	0.13	0.13
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 106.38 s
Total hot run time: 30.6 s

@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow morrySnow force-pushed the fix_anonymous_alias branch from 62ba654 to ea562e5 Compare January 17, 2025 03:10
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17588	5486	5391	5391
q2	2047	296	179	179
q3	10458	1226	729	729
q4	10278	960	532	532
q5	8670	2428	2156	2156
q6	197	168	135	135
q7	902	766	596	596
q8	9241	1369	1185	1185
q9	5085	4921	4885	4885
q10	6851	2353	1885	1885
q11	469	268	258	258
q12	341	361	224	224
q13	17778	3754	3162	3162
q14	240	233	217	217
q15	518	476	449	449
q16	617	616	586	586
q17	564	867	318	318
q18	7047	6431	6418	6418
q19	4071	930	527	527
q20	303	323	190	190
q21	2760	2184	1995	1995
q22	371	341	315	315
Total cold run time: 106396 ms
Total hot run time: 32332 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5630	5479	5494	5479
q2	242	326	235	235
q3	2205	2643	2366	2366
q4	1377	1778	1327	1327
q5	4318	4706	4755	4706
q6	172	166	129	129
q7	2054	1949	1804	1804
q8	2621	2858	2704	2704
q9	7275	7203	7252	7203
q10	2989	3325	2675	2675
q11	567	522	488	488
q12	676	827	666	666
q13	3486	3941	3274	3274
q14	297	310	287	287
q15	544	471	461	461
q16	639	696	660	660
q17	1223	1709	1268	1268
q18	7647	7391	7330	7330
q19	779	951	1151	951
q20	1999	2085	1895	1895
q21	5692	5120	5118	5118
q22	594	646	557	557
Total cold run time: 53026 ms
Total hot run time: 51583 ms

@doris-robot
Copy link

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

query1	1294	937	950	937
query2	6412	2118	2091	2091
query3	10944	4453	4492	4453
query4	60686	29673	23292	23292
query5	5394	603	458	458
query6	430	224	171	171
query7	5544	509	296	296
query8	315	238	226	226
query9	8372	2556	2589	2556
query10	448	298	262	262
query11	17467	15106	15442	15106
query12	164	113	107	107
query13	1448	531	417	417
query14	10937	7069	6894	6894
query15	205	211	174	174
query16	7243	619	481	481
query17	1094	736	570	570
query18	1759	408	309	309
query19	190	174	150	150
query20	117	110	111	110
query21	210	118	102	102
query22	4505	4637	4673	4637
query23	34082	33428	33577	33428
query24	5583	2319	2436	2319
query25	452	467	407	407
query26	632	271	163	163
query27	1732	479	332	332
query28	4269	2449	2427	2427
query29	554	605	421	421
query30	216	207	156	156
query31	953	895	867	867
query32	73	64	58	58
query33	425	372	308	308
query34	747	869	532	532
query35	845	858	756	756
query36	1024	1077	999	999
query37	125	103	74	74
query38	4287	4278	4267	4267
query39	1516	1453	1443	1443
query40	202	130	101	101
query41	51	49	64	49
query42	117	105	107	105
query43	546	555	506	506
query44	1293	814	854	814
query45	185	174	171	171
query46	889	1058	662	662
query47	1942	1961	1876	1876
query48	378	395	329	329
query49	687	486	388	388
query50	667	690	406	406
query51	7078	7091	7078	7078
query52	109	102	93	93
query53	225	250	182	182
query54	479	513	427	427
query55	82	87	83	83
query56	254	297	248	248
query57	1229	1113	1104	1104
query58	247	228	237	228
query59	2959	3141	2986	2986
query60	269	265	245	245
query61	117	134	109	109
query62	723	724	653	653
query63	218	186	187	186
query64	1239	1072	656	656
query65	3276	3153	3144	3144
query66	649	397	292	292
query67	15920	15826	15561	15561
query68	2425	812	544	544
query69	457	294	264	264
query70	1198	1069	1131	1069
query71	393	279	257	257
query72	5412	3833	3683	3683
query73	636	756	350	350
query74	10042	9058	8691	8691
query75	3231	3125	2672	2672
query76	2970	1142	764	764
query77	455	369	272	272
query78	10060	10021	9440	9440
query79	979	880	587	587
query80	1125	564	469	469
query81	545	288	247	247
query82	232	152	122	122
query83	256	251	149	149
query84	288	95	75	75
query85	764	377	299	299
query86	395	309	312	309
query87	4503	4403	4423	4403
query88	3163	2147	2121	2121
query89	390	326	291	291
query90	1539	198	190	190
query91	128	134	107	107
query92	62	55	53	53
query93	950	835	532	532
query94	710	396	305	305
query95	335	262	333	262
query96	484	606	279	279
query97	2774	2892	2781	2781
query98	218	194	202	194
query99	1272	1367	1290	1290
Total cold run time: 303114 ms
Total hot run time: 194509 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.07	0.03	0.03
query3	0.25	0.07	0.06
query4	1.62	0.11	0.10
query5	0.43	0.42	0.41
query6	1.17	0.66	0.67
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.60	0.54	0.50
query10	0.56	0.56	0.55
query11	0.14	0.10	0.10
query12	0.14	0.11	0.10
query13	0.61	0.60	0.60
query14	2.71	2.74	2.77
query15	0.90	0.83	0.84
query16	0.39	0.38	0.38
query17	1.00	1.06	1.06
query18	0.22	0.20	0.21
query19	1.86	1.82	1.94
query20	0.01	0.01	0.01
query21	15.36	0.93	0.59
query22	0.75	1.05	0.70
query23	15.01	1.45	0.49
query24	3.39	0.80	1.96
query25	0.14	0.14	0.05
query26	0.25	0.17	0.14
query27	0.08	0.04	0.05
query28	13.65	0.97	0.43
query29	12.57	4.03	3.37
query30	0.25	0.08	0.06
query31	2.82	0.58	0.38
query32	3.22	0.54	0.45
query33	3.04	3.10	3.04
query34	16.55	5.15	4.47
query35	4.51	4.46	4.53
query36	0.65	0.49	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.02
query40	0.17	0.13	0.12
query41	0.08	0.02	0.03
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.51 s
Total hot run time: 30.46 s

@morrySnow morrySnow requested a review from englefly January 17, 2025 04:16
@morrySnow morrySnow force-pushed the fix_anonymous_alias branch from ea562e5 to 06df755 Compare January 17, 2025 07:20
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17574	6226	5331	5331
q2	2057	294	185	185
q3	10422	1201	736	736
q4	10218	948	526	526
q5	8009	2336	2114	2114
q6	190	164	133	133
q7	889	762	595	595
q8	9253	1351	1153	1153
q9	5129	4955	4818	4818
q10	6878	2309	1889	1889
q11	483	281	256	256
q12	344	352	220	220
q13	17780	3664	3083	3083
q14	239	234	215	215
q15	520	479	461	461
q16	626	622	593	593
q17	552	852	319	319
q18	6930	6412	6508	6412
q19	2070	942	519	519
q20	296	304	184	184
q21	2745	2125	2143	2125
q22	378	346	314	314
Total cold run time: 103582 ms
Total hot run time: 32181 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5592	5560	5465	5465
q2	236	341	241	241
q3	2273	2706	2308	2308
q4	1436	1834	1355	1355
q5	4398	4736	4596	4596
q6	164	164	131	131
q7	2024	1927	1828	1828
q8	2579	2834	2691	2691
q9	7277	7219	7274	7219
q10	3047	3277	2755	2755
q11	583	516	486	486
q12	638	729	581	581
q13	3476	3986	3261	3261
q14	281	300	269	269
q15	525	467	459	459
q16	646	688	641	641
q17	1233	1729	1246	1246
q18	7702	7452	7226	7226
q19	775	1156	1015	1015
q20	2040	2038	1882	1882
q21	5801	5119	4844	4844
q22	590	610	556	556
Total cold run time: 53316 ms
Total hot run time: 51055 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195050 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 06df7554b029a45465e6a55e171eeab420bb18ca, data reload: false

query1	1342	966	924	924
query2	6215	2030	2062	2030
query3	10961	4341	4458	4341
query4	60933	29141	23530	23530
query5	5550	598	457	457
query6	449	191	193	191
query7	5482	494	312	312
query8	331	243	230	230
query9	7918	2599	2584	2584
query10	447	310	250	250
query11	17168	15163	15637	15163
query12	164	114	116	114
query13	1436	574	416	416
query14	11031	7441	7289	7289
query15	231	196	195	195
query16	7178	629	471	471
query17	1106	734	553	553
query18	1884	413	329	329
query19	194	172	159	159
query20	122	118	111	111
query21	210	122	100	100
query22	4549	5006	4548	4548
query23	34319	33417	33298	33298
query24	5624	2349	2353	2349
query25	472	462	411	411
query26	657	273	155	155
query27	1687	486	326	326
query28	4009	2426	2404	2404
query29	526	549	418	418
query30	225	188	152	152
query31	917	885	828	828
query32	70	57	56	56
query33	418	368	303	303
query34	720	845	524	524
query35	791	869	763	763
query36	1007	1035	1021	1021
query37	117	101	74	74
query38	4310	4463	4180	4180
query39	1493	1460	1480	1460
query40	208	118	104	104
query41	56	54	49	49
query42	114	102	102	102
query43	525	507	497	497
query44	1319	812	809	809
query45	189	182	167	167
query46	872	1075	665	665
query47	1927	1954	1909	1909
query48	393	404	321	321
query49	702	515	414	414
query50	644	665	397	397
query51	7046	7121	6936	6936
query52	100	98	93	93
query53	225	253	182	182
query54	469	489	435	435
query55	87	84	80	80
query56	256	272	271	271
query57	1235	1198	1191	1191
query58	241	242	286	242
query59	3243	3228	2966	2966
query60	272	260	248	248
query61	116	111	113	111
query62	752	700	679	679
query63	222	187	182	182
query64	1243	1017	647	647
query65	3208	3212	3149	3149
query66	704	387	295	295
query67	16147	15833	15736	15736
query68	5032	826	523	523
query69	480	286	271	271
query70	1196	1142	1134	1134
query71	411	275	249	249
query72	6031	3913	3768	3768
query73	806	740	363	363
query74	9813	8827	8779	8779
query75	3245	3143	2646	2646
query76	3797	1187	745	745
query77	479	348	271	271
query78	10097	10011	9317	9317
query79	3266	808	594	594
query80	1572	611	440	440
query81	544	266	238	238
query82	637	150	123	123
query83	277	181	162	162
query84	280	96	77	77
query85	784	337	309	309
query86	433	315	301	301
query87	4391	4544	4486	4486
query88	4701	2145	2133	2133
query89	400	328	290	290
query90	1613	190	189	189
query91	138	134	103	103
query92	68	57	58	57
query93	2977	863	529	529
query94	924	415	311	311
query95	330	268	265	265
query96	488	622	280	280
query97	2886	2925	2751	2751
query98	223	196	196	196
query99	1263	1373	1254	1254
Total cold run time: 314360 ms
Total hot run time: 195050 ms

@doris-robot
Copy link

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

query1	0.04	0.05	0.03
query2	0.07	0.03	0.04
query3	0.25	0.07	0.06
query4	1.63	0.10	0.11
query5	0.41	0.43	0.42
query6	1.17	0.65	0.66
query7	0.02	0.02	0.01
query8	0.04	0.04	0.03
query9	0.60	0.51	0.49
query10	0.57	0.56	0.56
query11	0.14	0.10	0.10
query12	0.14	0.11	0.10
query13	0.61	0.60	0.59
query14	2.72	2.84	2.71
query15	0.91	0.83	0.83
query16	0.38	0.39	0.38
query17	1.07	0.98	0.99
query18	0.23	0.20	0.21
query19	1.88	1.82	2.00
query20	0.02	0.00	0.02
query21	15.35	0.94	0.59
query22	0.75	0.80	0.72
query23	15.23	1.46	0.60
query24	2.60	1.48	0.97
query25	0.23	0.18	0.08
query26	0.33	0.14	0.14
query27	0.05	0.04	0.04
query28	13.73	1.03	0.43
query29	12.60	3.90	3.25
query30	0.25	0.09	0.06
query31	2.83	0.59	0.39
query32	3.23	0.55	0.47
query33	3.01	3.05	3.06
query34	16.72	5.13	4.44
query35	4.50	4.48	4.58
query36	0.62	0.49	0.47
query37	0.10	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.12
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.42 s
Total hot run time: 30.58 s

@morrySnow
Copy link
Contributor Author

run cloud_p0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants