Skip to content

Conversation

@xiedeyantu
Copy link
Member

Proposed changes

Issue Number: close #xxx

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xiedeyantu
Copy link
Member Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.27% (8729/24747)
Line Coverage: 27.08% (71436/263767)
Region Coverage: 26.33% (37076/140816)
Branch Coverage: 23.23% (18956/81586)
Coverage Report: http://coverage.selectdb-in.cc/coverage/34c1b1ae66f5ffa1d375a7283ce5c88db2b75691_34c1b1ae66f5ffa1d375a7283ce5c88db2b75691/report/index.html

*/
public class Sum0 extends AggregateFunction
implements UnaryExpression, AlwaysNotNullable, ExplicitlyCastableSignature, ComputePrecisionForSum,
SupportWindowAnalytic, CouldRollUp {
Copy link
Contributor

Choose a reason for hiding this comment

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

do sum0 really support window?

*/
public class Sum0 extends AggregateFunction
implements UnaryExpression, AlwaysNotNullable, ExplicitlyCastableSignature, ComputePrecisionForSum,
SupportWindowAnalytic, CouldRollUp {
Copy link
Contributor

Choose a reason for hiding this comment

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

@seawinde PTAL, does sum0 could implement CouldRollUp?

Copy link
Member Author

Choose a reason for hiding this comment

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

@seawinde PTAL, does sum0 could implement CouldRollUp?

keep the behavior to sum?

Comment on lines 79 to 83
public MultiDistinctSum convertToMultiDistinct() {
Preconditions.checkArgument(distinct,
"can't convert to multi_distinct_sum because there is no distinct args");
return new MultiDistinctSum(false, child());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

sum0 should convert to MultiDistinctSum0?

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xiedeyantu
Copy link
Member Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xiedeyantu
Copy link
Member Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.26% (8734/24767)
Line Coverage: 27.06% (71515/264306)
Region Coverage: 26.30% (37103/141100)
Branch Coverage: 23.19% (18973/81818)
Coverage Report: http://coverage.selectdb-in.cc/coverage/fcc79fc3b0dd966cdcb79c727147cc8889e601a3_fcc79fc3b0dd966cdcb79c727147cc8889e601a3/report/index.html

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.26% (8734/24767)
Line Coverage: 27.06% (71524/264306)
Region Coverage: 26.30% (37112/141100)
Branch Coverage: 23.20% (18980/81818)
Coverage Report: http://coverage.selectdb-in.cc/coverage/a0540bd55cda57bac573d77902973f187ed9fb2d_a0540bd55cda57bac573d77902973f187ed9fb2d/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17683	4143	4088	4088
q2	2111	151	149	149
q3	10588	1100	1199	1100
q4	10229	803	741	741
q5	7449	3005	3003	3003
q6	202	126	125	125
q7	1047	588	566	566
q8	9331	1987	2018	1987
q9	7205	6629	6540	6540
q10	8466	3459	3553	3459
q11	441	221	227	221
q12	445	203	199	199
q13	17798	2844	2868	2844
q14	234	209	217	209
q15	501	472	467	467
q16	510	382	371	371
q17	946	541	589	541
q18	7157	6473	6597	6473
q19	2724	1473	1405	1405
q20	554	280	258	258
q21	3610	2957	2944	2944
q22	357	301	299	299
Total cold run time: 109588 ms
Total hot run time: 37989 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4159	4161	4111	4111
q2	324	233	224	224
q3	3019	2903	2876	2876
q4	1883	1626	1575	1575
q5	5346	5376	5383	5376
q6	197	117	120	117
q7	2279	1869	1845	1845
q8	3184	3311	3316	3311
q9	8795	8920	8987	8920
q10	4010	3941	3947	3941
q11	569	470	452	452
q12	760	596	609	596
q13	18368	2966	2918	2918
q14	284	263	261	261
q15	513	470	487	470
q16	514	462	418	418
q17	1738	1521	1466	1466
q18	7694	7387	7099	7099
q19	1656	1512	1538	1512
q20	1895	1704	1721	1704
q21	4705	4626	4761	4626
q22	531	435	451	435
Total cold run time: 72423 ms
Total hot run time: 54253 ms

@doris-robot
Copy link

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

query1	955	366	359	359
query2	7405	2046	1997	1997
query3	6700	210	216	210
query4	31751	21469	21359	21359
query5	4334	427	430	427
query6	270	181	174	174
query7	4638	295	307	295
query8	227	170	177	170
query9	9347	2250	2258	2250
query10	561	249	260	249
query11	17569	14310	14650	14310
query12	137	93	90	90
query13	1632	424	415	415
query14	12688	11248	11473	11248
query15	294	206	197	197
query16	8230	259	259	259
query17	2114	599	545	545
query18	2113	316	285	285
query19	366	164	165	164
query20	98	86	90	86
query21	205	134	133	133
query22	4992	4734	4738	4734
query23	33376	32589	32764	32589
query24	10582	2911	2830	2830
query25	584	368	377	368
query26	971	153	157	153
query27	2344	354	346	346
query28	6341	1887	1842	1842
query29	838	645	610	610
query30	303	146	144	144
query31	967	734	733	733
query32	91	57	59	57
query33	760	264	254	254
query34	1060	475	483	475
query35	843	609	608	608
query36	1015	858	874	858
query37	118	78	74	74
query38	3556	3444	3446	3444
query39	1463	1439	1423	1423
query40	208	113	111	111
query41	47	48	46	46
query42	100	98	96	96
query43	504	440	454	440
query44	1152	731	723	723
query45	267	257	274	257
query46	1118	726	704	704
query47	1916	1809	1832	1809
query48	443	357	344	344
query49	1073	335	343	335
query50	765	363	360	360
query51	6683	6584	6690	6584
query52	113	92	86	86
query53	348	281	282	281
query54	322	246	249	246
query55	82	84	84	84
query56	260	243	245	243
query57	1208	1142	1126	1126
query58	245	213	216	213
query59	2890	2671	2591	2591
query60	274	249	272	249
query61	114	116	114	114
query62	670	428	464	428
query63	311	276	282	276
query64	5632	4155	4040	4040
query65	3071	3054	3039	3039
query66	883	383	376	376
query67	15235	14741	14576	14576
query68	6333	506	526	506
query69	609	408	379	379
query70	1202	1154	1112	1112
query71	488	290	281	281
query72	6721	2843	2572	2572
query73	729	311	315	311
query74	8291	6679	6643	6643
query75	3998	2877	2891	2877
query76	4399	866	875	866
query77	630	271	259	259
query78	11068	10169	10073	10073
query79	10054	517	524	517
query80	1651	424	388	388
query81	534	222	212	212
query82	836	207	207	207
query83	213	151	148	148
query84	287	81	86	81
query85	1389	320	321	320
query86	422	297	294	294
query87	3749	3569	3531	3531
query88	4699	2274	2261	2261
query89	524	374	371	371
query90	2031	177	176	176
query91	175	135	138	135
query92	64	48	49	48
query93	6674	500	487	487
query94	1217	178	181	178
query95	426	335	329	329
query96	604	275	274	274
query97	3082	2890	2880	2880
query98	233	215	211	211
query99	1198	951	929	929
Total cold run time: 312302 ms
Total hot run time: 186397 ms

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit a0540bd55cda57bac573d77902973f187ed9fb2d with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       21.6 seconds inserted 10000000 Rows, about 462K ops/s

morrySnow
morrySnow previously approved these changes Mar 26, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 26, 2024
@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.

@924060929
Copy link
Contributor

add regression test please

@xiedeyantu
Copy link
Member Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xiedeyantu
Copy link
Member Author

add regression test please

@924060929 I finish the test, review please.

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.27% (8738/24777)
Line Coverage: 27.05% (71536/264504)
Region Coverage: 26.28% (37115/141211)
Branch Coverage: 23.18% (18975/81874)
Coverage Report: http://coverage.selectdb-in.cc/coverage/d6cf2fd693cc66303df92c3867707c5a87874428_d6cf2fd693cc66303df92c3867707c5a87874428/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17614	4392	4230	4230
q2	2218	173	152	152
q3	12225	1121	1210	1121
q4	10784	808	871	808
q5	7766	3095	3056	3056
q6	207	126	125	125
q7	1071	617	603	603
q8	10198	1993	2050	1993
q9	7364	6728	6733	6728
q10	9750	3440	3549	3440
q11	424	225	220	220
q12	368	200	204	200
q13	17796	2901	2860	2860
q14	245	205	208	205
q15	496	448	453	448
q16	453	374	382	374
q17	948	542	540	540
q18	7186	6529	6497	6497
q19	1572	1381	1377	1377
q20	566	262	261	261
q21	3496	2853	2968	2853
q22	342	290	285	285
Total cold run time: 113089 ms
Total hot run time: 38376 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4088	4040	4033	4033
q2	328	224	226	224
q3	2953	2805	2818	2805
q4	1863	1570	1565	1565
q5	5260	5340	5489	5340
q6	198	117	117	117
q7	2314	1899	1853	1853
q8	3147	3285	3267	3267
q9	8659	8649	8665	8649
q10	3764	3771	3767	3767
q11	544	444	443	443
q12	719	526	537	526
q13	16896	2858	2839	2839
q14	282	254	259	254
q15	493	455	464	455
q16	458	419	408	408
q17	1737	1502	1468	1468
q18	7594	7237	7178	7178
q19	1612	1534	1522	1522
q20	1913	1732	1724	1724
q21	4899	4770	4794	4770
q22	513	459	448	448
Total cold run time: 70234 ms
Total hot run time: 53655 ms

@doris-robot
Copy link

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

query1	944	369	346	346
query2	6549	1971	2027	1971
query3	6713	220	236	220
query4	31783	21219	21255	21219
query5	4348	403	391	391
query6	264	180	167	167
query7	4622	298	297	297
query8	227	177	180	177
query9	9280	2235	2247	2235
query10	553	252	255	252
query11	17255	14276	14125	14125
query12	131	91	85	85
query13	1620	417	419	417
query14	9903	8031	7878	7878
query15	262	209	209	209
query16	8165	271	263	263
query17	1944	581	554	554
query18	2106	296	287	287
query19	345	169	164	164
query20	97	90	89	89
query21	200	127	130	127
query22	4953	4884	4782	4782
query23	33289	32718	32756	32718
query24	11977	2838	2892	2838
query25	656	405	385	385
query26	1858	153	151	151
query27	3120	345	350	345
query28	7591	1878	1846	1846
query29	1046	622	618	618
query30	304	141	144	141
query31	989	725	734	725
query32	91	62	54	54
query33	753	250	243	243
query34	1112	467	482	467
query35	828	626	611	611
query36	1035	884	877	877
query37	264	65	61	61
query38	3556	3418	3448	3418
query39	1495	1449	1426	1426
query40	297	114	114	114
query41	50	45	45	45
query42	99	94	95	94
query43	493	439	458	439
query44	1267	724	733	724
query45	262	259	267	259
query46	1087	716	691	691
query47	1908	1868	1822	1822
query48	436	360	387	360
query49	1218	330	338	330
query50	763	374	370	370
query51	6796	6659	6629	6629
query52	104	98	92	92
query53	350	271	278	271
query54	308	230	226	226
query55	84	84	81	81
query56	245	213	221	213
query57	1214	1111	1129	1111
query58	230	202	205	202
query59	2854	2614	2653	2614
query60	264	247	241	241
query61	105	114	114	114
query62	651	459	453	453
query63	313	287	284	284
query64	6909	4116	4062	4062
query65	3090	3055	3030	3030
query66	1444	385	367	367
query67	15177	14767	14726	14726
query68	6161	540	532	532
query69	599	389	409	389
query70	1236	1108	1185	1108
query71	478	272	286	272
query72	6505	2866	2638	2638
query73	729	326	321	321
query74	7860	6412	6399	6399
query75	3378	2182	2227	2182
query76	4314	912	965	912
query77	599	258	260	258
query78	10859	10083	10132	10083
query79	9544	513	535	513
query80	1663	368	370	368
query81	509	218	213	213
query82	740	83	84	83
query83	239	144	158	144
query84	287	77	78	77
query85	1439	325	313	313
query86	410	285	283	283
query87	3758	3573	3537	3537
query88	4869	2370	2375	2370
query89	496	374	391	374
query90	1979	176	175	175
query91	174	135	151	135
query92	57	47	53	47
query93	6955	493	480	480
query94	1169	179	175	175
query95	418	324	327	324
query96	622	280	276	276
query97	2645	2430	2498	2430
query98	220	218	210	210
query99	1262	872	885	872
Total cold run time: 312419 ms
Total hot run time: 181636 ms

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit d6cf2fd693cc66303df92c3867707c5a87874428 with default session variables
Stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      31 seconds loaded 861443392 Bytes, about 26 MB/s
Insert into select:       20.2 seconds inserted 10000000 Rows, about 495K ops/s

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xiedeyantu
Copy link
Member Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17854	4482	4262	4262
q2	2336	171	176	171
q3	10973	1165	1241	1165
q4	10840	759	794	759
q5	7583	3114	3047	3047
q6	209	123	128	123
q7	1072	604	574	574
q8	9345	2068	1998	1998
q9	7143	6617	6581	6581
q10	8426	3482	3575	3482
q11	421	218	227	218
q12	377	207	197	197
q13	17801	2877	2864	2864
q14	236	206	214	206
q15	518	458	460	458
q16	467	384	386	384
q17	963	634	566	566
q18	7260	6624	6491	6491
q19	1563	1452	1474	1452
q20	581	277	268	268
q21	3635	3003	2878	2878
q22	367	307	315	307
Total cold run time: 109970 ms
Total hot run time: 38451 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4080	4128	4063	4063
q2	330	231	230	230
q3	2999	2859	2839	2839
q4	1822	1598	1570	1570
q5	5318	5367	5364	5364
q6	191	116	118	116
q7	2290	1864	1882	1864
q8	3180	3312	3308	3308
q9	8758	8662	8720	8662
q10	3889	3781	3818	3781
q11	555	456	455	455
q12	714	542	555	542
q13	16926	2846	2853	2846
q14	289	273	272	272
q15	504	461	462	461
q16	472	434	435	434
q17	1716	1486	1481	1481
q18	7407	7133	7207	7133
q19	1628	1518	1521	1518
q20	1923	1763	1712	1712
q21	5057	4829	4728	4728
q22	521	464	449	449
Total cold run time: 70569 ms
Total hot run time: 53828 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 181852 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 8757f527612311c6bc80dbd0fd57cd3465c9a4ca, data reload: false

query1	946	374	364	364
query2	6990	1917	1863	1863
query3	6707	213	217	213
query4	31867	21513	21405	21405
query5	4291	412	395	395
query6	275	199	172	172
query7	4640	289	280	280
query8	229	168	176	168
query9	9395	2331	2337	2331
query10	567	246	255	246
query11	17398	14190	14275	14190
query12	137	97	91	91
query13	1644	415	425	415
query14	10180	7870	8010	7870
query15	257	201	197	197
query16	8248	270	264	264
query17	1985	569	535	535
query18	2086	276	272	272
query19	352	149	147	147
query20	96	89	86	86
query21	193	122	127	122
query22	5012	4842	4793	4793
query23	33314	32849	33169	32849
query24	11800	2841	2869	2841
query25	643	365	368	365
query26	1809	152	157	152
query27	3085	349	343	343
query28	7696	1897	1882	1882
query29	1021	648	632	632
query30	315	149	149	149
query31	963	754	739	739
query32	103	59	55	55
query33	773	261	249	249
query34	1102	489	485	485
query35	832	603	615	603
query36	1009	863	901	863
query37	272	66	67	66
query38	3552	3481	3391	3391
query39	1469	1452	1401	1401
query40	291	115	118	115
query41	52	51	47	47
query42	107	101	96	96
query43	484	452	450	450
query44	1228	739	730	730
query45	286	258	266	258
query46	1112	701	688	688
query47	1900	1838	1842	1838
query48	446	374	357	357
query49	1235	344	369	344
query50	780	377	372	372
query51	6720	6594	6546	6546
query52	114	92	97	92
query53	343	278	279	278
query54	322	250	244	244
query55	100	84	79	79
query56	250	230	227	227
query57	1224	1148	1145	1145
query58	229	201	211	201
query59	2830	2616	2557	2557
query60	267	245	251	245
query61	117	115	116	115
query62	666	437	464	437
query63	308	278	279	278
query64	6942	4134	4025	4025
query65	3182	3062	3055	3055
query66	1451	394	380	380
query67	15399	14906	14815	14815
query68	7149	538	530	530
query69	617	383	375	375
query70	1233	1129	1108	1108
query71	518	272	264	264
query72	6355	2707	2548	2548
query73	741	317	317	317
query74	6744	6394	6354	6354
query75	3711	2258	2222	2222
query76	5006	879	950	879
query77	636	276	256	256
query78	10899	10243	10133	10133
query79	11352	528	534	528
query80	1895	380	370	370
query81	514	213	214	213
query82	468	88	90	88
query83	226	150	147	147
query84	287	78	83	78
query85	1170	323	310	310
query86	375	295	275	275
query87	3729	3487	3528	3487
query88	4811	2298	2300	2298
query89	486	383	373	373
query90	2070	179	174	174
query91	168	134	138	134
query92	59	47	47	47
query93	7185	496	481	481
query94	1327	176	178	176
query95	434	328	325	325
query96	590	268	281	268
query97	2633	2487	2495	2487
query98	238	219	205	205
query99	1190	952	904	904
Total cold run time: 316454 ms
Total hot run time: 181852 ms

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit 8757f527612311c6bc80dbd0fd57cd3465c9a4ca with default session variables
Stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
Stream load orc:          59 seconds loaded 1101869774 Bytes, about 17 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       13.7 seconds inserted 10000000 Rows, about 729K ops/s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.25% (8740/24797)
Line Coverage: 27.03% (71540/264660)
Region Coverage: 26.28% (37124/141278)
Branch Coverage: 23.17% (18976/81908)
Coverage Report: http://coverage.selectdb-in.cc/coverage/8757f527612311c6bc80dbd0fd57cd3465c9a4ca_8757f527612311c6bc80dbd0fd57cd3465c9a4ca/report/index.html

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

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

@morrySnow morrySnow merged commit 4967ff6 into apache:master Mar 28, 2024
Jibing-Li added a commit that referenced this pull request Mar 29, 2024
* [fix](merge cloud) Fix cloud be set be tag map (#32864)

* [chore] Add gavinchou to collaborators (#32881)

* [chore](show) support statement to show views from table (#32358)

MySQL [test]> show views;
+----------------+
| Tables_in_test |
+----------------+
| t1_view        |
| t2_view        |
+----------------+
2 rows in set (0.00 sec)

MySQL [test]> show views like '%t1%';
+----------------+
| Tables_in_test |
+----------------+
| t1_view        |
+----------------+
1 row in set (0.01 sec)

MySQL [test]> show views where create_time > '2024-03-18';
+----------------+
| Tables_in_test |
+----------------+
| t2_view        |
+----------------+
1 row in set (0.02 sec)

* [Enhancement](ranger) Disable some permission operations when Ranger or LDAP are enabled (#32538)

Disable some permission operations when Ranger or LDAP are enabled.

* [chore](ci) exclude unstable trino_connector case (#32892)

Co-authored-by: stephen <hello-stephen@qq.com>

* [fix](Nereids) NPE when create table with implicit index type (#32893)

* [improvement](mtmv) Support more join types for query rewriting by materialized view (#32685)

This pattern of rewriting is supported for multi-table joins and supported join types is as following:

INNER JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
FULL OUTER JOIN
LEFT SEMI JOIN
RIGHT SEMI JOIN
LEFT ANTI JOIN
RIGHT ANTI JOIN

* [Serde](Variant) support arrow serialization for varint type (#32780)

* [fix](multicatalog) fix no data error when read hive table on cosn (#32815)

Currently, when reading a hive on cosn table, doris return empty result, but the table has data.
iceberg on cosn is ok.
The reason is misuse of cosn's file sytem. according to cosn's doc, its fs.cosn.impl should be org.apache.hadoop.fs.CosFileSystem

* [fix](nereids)EliminateGroupByConstant should replace agg's output after removing constant group by keys (#32878)

* [Fix](executor)Fix regression test for test_active_queries/test_backend_active_tasks #32899

* [fix](iceberg) fix iceberg catalog bug and p2 test cases (#32898)

1. Fix iceberg catalog bug

    This PR #30198 change the logic of `IcebergHMSExternalCatalog.java`,
    to get locationUrl by calling hive metastore's `getCatalog()` method.
    But this method only exists in hive 3+. So it will fail if we using hive 2.x.

    I temporary remove this logic, because this logic is only used from iceberg table writing.
    Which is still under development. We will rethink this logic later.

2. Fix test cases

    Some of P2 test cases missed `order_qt`. And because the output format of the floating point
    type is changed, some result in `out` files need to be regenerated.

* [revert](jni) revert part of #32455 (#32904)

* [fix](spill) Avoid releasing resources while spill tasks are executing (#32783)

* [chore](log) print query id before logging profile in be.INFO (#32922)

* [fix](grace-exit) Stop incorrectly of reportwork cause heap use after free #32929

* [improvement](decommission be) decommission check replica num (#32748)

* [fix](arrow-flight) Fix reach limit of connections error (#32911)

Fix Reach limit of connections error
in fe.conf , arrow_flight_token_cache_size is mandatory less than qe_max_connection/2. arrow flight sql is a stateless protocol, connection is usually not actively disconnected, bearer token is evict from the cache will unregister ConnectContext.

Fix ConnectContext.command not be reset to COM_SLEEP in time, this will result in frequent kill connection after query timeout.

Fix bearer token evict log and exception.

TODO: use arrow flight session: https://mail.google.com/mail/u/0/#inbox/FMfcgzGxRdxBLQLTcvvtRpqsvmhrHpdH

* [bugfix](cloud) few variable not initialized (#32868)

../../cloud/src/recycler/meta_checker.cpp
can cause uninitialised memory read.

* [fix](arrow-flight) Fix arrow flight sql compatible with JDK 17 and upgrade arrow 15.0.2 (#32796)

--add-opens=java.base/java.nio=ALL-UNNAMED, see: https://arrow.apache.org/docs/java/install.html#java-compatibility
groovy use flight sql connection to execute query SUM(MAX(c1) OVER (PARTITION BY)) report error: AGGREGATE clause must not contain analytic expressions, but no problem in Java execute it with jdbc::arrow-flight-sql.
groovy not support print arrow array type, throw IndexOutOfBoundsException.
"arrow_flight_sql" not support two phase read
./run-regression-test.sh --run --clean -g arrow_flight_sql

* [fix](spill) SpillStream's writer maybe may not have been finalized (#32931)

* [improvement](spill) Disable DistinctStreamingAgg when spill is enabled (#32932)

* [Improve](inverted_index) update clucene and improve array inverted index writer  (#32436)

* [Performance](exec) replace SipHash in function by XXHash (#32919)

* [feature](agg) add aggregate function sum0 (#32541)

* [improvement](mtmv) Support to get tables in materialized view when collecting table in plan (#32797)

Support to get tables in materialized view when collecting table in plan

table scehma as fllowing:

create materialized view mv1
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 1 
PROPERTIES ('replication_num' = '1')
 as 
select 
  t1.c1, 
  t3.c2 
from 
  table1 t1 
  inner join table3 t3 on t1.c1 = t3.c2

if get table from the plan as follwoing, we can get [table1, table3, table2], the mv1 is expanded to get base tables;

SELECT 
  mv1.*, 
  uuid() 
FROM 
  mv1 LEFT SEMI 
  JOIN table2 ON mv1.c1 = table2.c1 
WHERE 
  mv1.c1 IN (
    SELECT 
      c1 
    FROM 
      table2
  ) 
  OR mv1.c1 < 10

* [enhance](mtmv)support olap table partition column is null (#32698)

* [enhancement](cloud) add table version to cloud (#32738)

Add table version to cloud.

In Fe:
Get: If Fe is cloud mode, get table version from meta service.
Update: Op drop/replace temp partition, commit transaction.

In meta service:
Add: create Index. init value is 1.
Remove: by recycler.
Update: commit/drop partition rpc, commit txn rpc. Atomic++.

* [fix](cloud) schema change from not null to null (#32913)

1. Use equals instead of == for type comparing
2. null bitmap size is reisze by size of ref column.

* [feature](Nereids): add ColumnPruningPostProcessor. (#32800)

* [case](rowpolicy)fix row policy has been exist (#32880)

* [fix](pipeline) fix use error row desc when origin block clear (#32803)

* [fix](Nereids) support variant column with index when create table (#32948)

* [opt](Nereids) support create table with variant type (#32953)

* [test](insert-overwrite) Add insert overwrite auto detect concurrency cases (#32935)

* [fix](compile) fe cannot compile in idea (#32955)

* [enhancement](plsql) Support select * from routines (#32866)

Support show of plsql procedure using select * from routines.

* [fix](trino-connector) fix `NoClassDefFoundError` of hudi `Utils` class (#32846)

Due to the change of this PR #32455 , the `trino-connector-scanner` package cannot access the `hudi_scanner` package, so the exception NoclassDeffounderror will appear.

We need to write a separate Utils class.

* [exec](column) change some complex column move to noexcept (#32954)

* [Enhancement](data skew) extends show data skew (#32732)

* [chore](test) let suite compatible with Nereids (#32964)

* Support identical column name in different index. (#32792)

* Limit the max string length to 1024 while collecting column stats to control BE memory usage. (#32470)

* [fix](merge-iterator) fix NOT_IMPLEMENTED_ERROR when read next block view (#32961)

* [improvement](executor)Add tag property for workload group #32874

* [fix](auth)unified workload and resource permission logic (#32907)

- `Grant resource` can no longer grant global `usage_priv`
-  `grant resource %` instead of `grant resource *`

before change:
```
grant usage_priv on resource * to f;
show grants for f\G
*************************** 1. row ***************************
      UserIdentity: 'f'@'%'
           Comment: 
          Password: No
             Roles: 
       GlobalPrivs: Usage_priv 
      CatalogPrivs: NULL
     DatabasePrivs: internal.information_schema: Select_priv ; internal.mysql: Select_priv 
        TablePrivs: NULL
          ColPrivs: NULL
     ResourcePrivs: NULL
 CloudClusterPrivs: NULL
WorkloadGroupPrivs: normal: Usage_priv 
```
after change
```
grant usage_priv on resource '%' to f;
show grants for f\G
*************************** 1. row ***************************
      UserIdentity: 'f'@'%'
           Comment: 
          Password: No
             Roles: 
       GlobalPrivs: NULL
      CatalogPrivs: NULL
     DatabasePrivs: internal.information_schema: Select_priv ; internal.mysql: Select_priv 
        TablePrivs: NULL
          ColPrivs: NULL
     ResourcePrivs: %: Usage_priv 
 CloudClusterPrivs: NULL
WorkloadGroupPrivs: normal: Usage_priv 

```

---------

Co-authored-by: yujun <yu.jun.reach@gmail.com>
Co-authored-by: Gavin Chou <gavineaglechou@gmail.com>
Co-authored-by: xy720 <22125576+xy720@users.noreply.github.com>
Co-authored-by: yongjinhou <109586248+yongjinhou@users.noreply.github.com>
Co-authored-by: Dongyang Li <hello_stephen@qq.com>
Co-authored-by: stephen <hello-stephen@qq.com>
Co-authored-by: morrySnow <101034200+morrySnow@users.noreply.github.com>
Co-authored-by: seawinde <149132972+seawinde@users.noreply.github.com>
Co-authored-by: lihangyu <15605149486@163.com>
Co-authored-by: Yulei-Yang <yulei.yang0699@gmail.com>
Co-authored-by: starocean999 <40539150+starocean999@users.noreply.github.com>
Co-authored-by: wangbo <wangbo@apache.org>
Co-authored-by: Mingyu Chen <morningman@163.com>
Co-authored-by: Jerry Hu <mrhhsg@gmail.com>
Co-authored-by: zhiqiang <seuhezhiqiang@163.com>
Co-authored-by: Xinyi Zou <zouxinyi02@gmail.com>
Co-authored-by: Vallish Pai <vallishpai@gmail.com>
Co-authored-by: amory <wangqiannan@selectdb.com>
Co-authored-by: HappenLee <happenlee@hotmail.com>
Co-authored-by: Jensen <czjourney@163.com>
Co-authored-by: zhangdong <493738387@qq.com>
Co-authored-by: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com>
Co-authored-by: jakevin <jakevingoo@gmail.com>
Co-authored-by: Mryange <59914473+Mryange@users.noreply.github.com>
Co-authored-by: zclllyybb <zhaochangle@selectdb.com>
Co-authored-by: Tiewei Fang <43782773+BePPPower@users.noreply.github.com>
Co-authored-by: Xin Liao <liaoxinbit@126.com>
morrySnow pushed a commit that referenced this pull request Jun 3, 2025
### What problem does this PR solve?

Related PR: #32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
github-actions bot pushed a commit that referenced this pull request Jun 3, 2025
### What problem does this PR solve?

Related PR: #32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
### What problem does this PR solve?

Related PR: apache#32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
github-actions bot pushed a commit that referenced this pull request Jun 20, 2025
### What problem does this PR solve?

Related PR: #32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
feiniaofeiafei added a commit to feiniaofeiafei/doris that referenced this pull request Jul 8, 2025
### What problem does this PR solve?

Related PR: apache#32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
feiniaofeiafei added a commit to feiniaofeiafei/doris that referenced this pull request Jul 9, 2025
### What problem does this PR solve?

Related PR: apache#32541

Problem Summary:
Before this pr, execute below sql will report error: sum0(DISTINCT c#2) can't support multi distinct.
This pr change the check, and the sql can be executed. sql is:
select sum0(distinct b),sum(distinct c) from test_sum0_multi_distinct_with_group_by group by a
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.

4 participants