Skip to content

branch-3.1 [feature](group by)Support group by with order. #53037#53847

Merged
morrySnow merged 1 commit intoapache:branch-3.1from
Jibing-Li:order3.1
Jul 25, 2025
Merged

branch-3.1 [feature](group by)Support group by with order. #53037#53847
morrySnow merged 1 commit intoapache:branch-3.1from
Jibing-Li:order3.1

Conversation

@Jibing-Li
Copy link
Contributor

backport: #53037

@Thearas
Copy link
Contributor

Thearas commented Jul 24, 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?

@Jibing-Li Jibing-Li marked this pull request as ready for review July 24, 2025 09:33
@Jibing-Li Jibing-Li requested a review from morrySnow as a code owner July 24, 2025 09:33
Support MariaDB syntax:
```
select a, sum(b) from tbl group by a [ASC | DESC];
```

We have use using looker BI to connect Doris as Mariadb, the BI may
generate SQLs like above, we should support his syntax to compatible
with looker BI.

See:
https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/group-by#with-rollup
@Jibing-Li
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17581	5541	5414	5414
q2	2055	296	163	163
q3	10746	1264	757	757
q4	10520	867	451	451
q5	9395	2362	2112	2112
q6	183	162	134	134
q7	902	755	624	624
q8	9334	1454	1196	1196
q9	5228	4924	4961	4924
q10	6783	2268	1822	1822
q11	482	280	260	260
q12	350	354	219	219
q13	17768	3602	3040	3040
q14	238	228	209	209
q15	512	482	489	482
q16	417	425	375	375
q17	609	859	352	352
q18	6867	6458	6222	6222
q19	1201	957	549	549
q20	329	344	210	210
q21	2948	2183	1983	1983
q22	1066	1013	996	996
Total cold run time: 105514 ms
Total hot run time: 32494 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5532	5515	5484	5484
q2	233	337	234	234
q3	2197	2648	2345	2345
q4	1322	1805	1339	1339
q5	4436	4896	5003	4896
q6	168	165	129	129
q7	2055	1978	1838	1838
q8	2570	2802	2711	2711
q9	7264	7221	7244	7221
q10	3000	3328	2788	2788
q11	561	501	497	497
q12	653	761	636	636
q13	3429	3786	3178	3178
q14	287	311	287	287
q15	530	481	491	481
q16	437	483	456	456
q17	1233	1723	1256	1256
q18	7493	7345	7524	7345
q19	875	1125	1152	1125
q20	2048	2063	1887	1887
q21	5379	4989	4736	4736
q22	1102	1072	981	981
Total cold run time: 52804 ms
Total hot run time: 51850 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 197461 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 5cde5d320477e25654cb8a4edb15a884052c7a7b, data reload: false

query1	1325	896	907	896
query2	6221	1928	1920	1920
query3	10934	4480	4488	4480
query4	32935	24472	23503	23503
query5	4044	607	460	460
query6	291	185	200	185
query7	3978	513	329	329
query8	302	266	245	245
query9	9549	2645	2628	2628
query10	474	337	262	262
query11	18038	15429	15093	15093
query12	159	105	108	105
query13	1553	557	430	430
query14	10083	6985	7898	6985
query15	238	207	185	185
query16	8041	681	502	502
query17	1574	789	611	611
query18	2136	414	332	332
query19	210	189	170	170
query20	128	120	118	118
query21	208	125	106	106
query22	4625	4598	4518	4518
query23	34839	34334	34122	34122
query24	7454	2720	2729	2720
query25	538	511	436	436
query26	1239	290	173	173
query27	2203	496	364	364
query28	5572	2251	2192	2192
query29	780	619	500	500
query30	246	204	166	166
query31	1009	902	882	882
query32	82	63	60	60
query33	498	360	300	300
query34	765	857	538	538
query35	772	841	749	749
query36	1029	1053	931	931
query37	106	90	71	71
query38	4092	4061	4005	4005
query39	1627	1473	1465	1465
query40	197	115	105	105
query41	49	48	52	48
query42	131	111	103	103
query43	536	534	485	485
query44	1401	856	863	856
query45	186	176	169	169
query46	914	1061	688	688
query47	1989	2024	1925	1925
query48	428	438	350	350
query49	764	491	403	403
query50	696	711	430	430
query51	7329	7390	7301	7301
query52	101	100	97	97
query53	228	261	188	188
query54	526	549	465	465
query55	82	84	87	84
query56	286	299	260	260
query57	1262	1304	1211	1211
query58	238	221	233	221
query59	3147	3341	3105	3105
query60	299	282	272	272
query61	161	142	119	119
query62	815	787	723	723
query63	239	204	205	204
query64	4406	1014	649	649
query65	3389	3294	3318	3294
query66	954	401	306	306
query67	15915	15695	15440	15440
query68	7809	831	544	544
query69	496	298	272	272
query70	1148	1091	1102	1091
query71	403	309	261	261
query72	5696	3721	3863	3721
query73	636	748	361	361
query74	10705	9325	9050	9050
query75	3198	3145	2685	2685
query76	3102	1178	798	798
query77	493	360	288	288
query78	10397	10429	9603	9603
query79	3342	919	593	593
query80	647	526	431	431
query81	509	261	223	223
query82	645	121	88	88
query83	173	157	144	144
query84	280	103	82	82
query85	778	369	290	290
query86	402	312	305	305
query87	4344	4351	4265	4265
query88	4902	2433	2424	2424
query89	417	329	309	309
query90	1757	191	188	188
query91	134	141	107	107
query92	63	58	54	54
query93	2145	881	536	536
query94	676	400	305	305
query95	342	289	269	269
query96	483	606	279	279
query97	3188	3247	3159	3159
query98	219	212	204	204
query99	1576	1452	1294	1294
Total cold run time: 297670 ms
Total hot run time: 197461 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.07	0.03	0.03
query3	0.23	0.06	0.06
query4	1.62	0.11	0.10
query5	0.53	0.54	0.53
query6	1.12	0.72	0.71
query7	0.02	0.01	0.01
query8	0.05	0.03	0.03
query9	0.57	0.50	0.52
query10	0.54	0.55	0.60
query11	0.14	0.11	0.11
query12	0.14	0.11	0.11
query13	0.61	0.60	0.59
query14	0.78	0.79	0.78
query15	0.84	0.83	0.82
query16	0.38	0.40	0.37
query17	1.07	1.07	1.04
query18	0.23	0.22	0.23
query19	1.88	1.83	1.78
query20	0.02	0.01	0.01
query21	15.38	0.88	0.57
query22	0.74	0.79	0.69
query23	15.07	1.52	0.52
query24	3.13	1.40	1.36
query25	0.14	0.21	0.16
query26	0.30	0.14	0.15
query27	0.05	0.06	0.04
query28	13.93	1.00	0.44
query29	12.60	3.97	3.30
query30	0.25	0.09	0.06
query31	2.84	0.60	0.38
query32	3.23	0.54	0.47
query33	2.97	3.04	3.03
query34	16.58	5.15	4.55
query35	4.60	4.61	4.58
query36	0.64	0.49	0.48
query37	0.09	0.06	0.05
query38	0.05	0.04	0.03
query39	0.04	0.03	0.02
query40	0.16	0.13	0.13
query41	0.07	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 103.81 s
Total hot run time: 29.43 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 46.51% (20/43) 🎉
Increment coverage report
Complete coverage report

@Jibing-Li
Copy link
Contributor Author

run cloud_p0

@Jibing-Li
Copy link
Contributor Author

run NonConcurrent

@morrySnow morrySnow changed the title branch-3.1 [feature](group by)Support group by with order. (#53037) branch-3.1 [feature](group by)Support group by with order. #53037 Jul 25, 2025
@morrySnow morrySnow merged commit 5d3aeda into apache:branch-3.1 Jul 25, 2025
22 checks passed
@morrySnow morrySnow deleted the order3.1 branch July 25, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments