Skip to content

Conversation

@Jibing-Li
Copy link
Contributor

backport: #53037

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
@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:57
@Jibing-Li Jibing-Li requested a review from dataroaring as a code owner July 24, 2025 09:57
@Jibing-Li
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17601	6836	6588	6588
q2	2073	177	200	177
q3	10497	1174	1158	1158
q4	10219	709	813	709
q5	7757	2882	2742	2742
q6	213	134	131	131
q7	973	618	598	598
q8	9374	1969	2047	1969
q9	6637	6425	6507	6425
q10	7022	2216	2274	2216
q11	470	262	263	262
q12	402	217	224	217
q13	17779	2951	2992	2951
q14	236	203	212	203
q15	517	477	459	459
q16	491	400	381	381
q17	966	585	536	536
q18	7547	6732	6644	6644
q19	1421	1075	1013	1013
q20	480	195	204	195
q21	3903	3040	3189	3040
q22	1130	989	999	989
Total cold run time: 107708 ms
Total hot run time: 39603 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6609	6616	6583	6583
q2	322	229	232	229
q3	2940	2934	2911	2911
q4	2070	1823	1857	1823
q5	5703	5741	5747	5741
q6	208	130	127	127
q7	2233	1825	1858	1825
q8	3368	3521	3488	3488
q9	8715	8902	8828	8828
q10	3561	3542	3528	3528
q11	585	488	513	488
q12	786	608	628	608
q13	9104	3221	3103	3103
q14	306	282	273	273
q15	518	475	453	453
q16	498	448	435	435
q17	1845	1660	1600	1600
q18	8264	7777	7706	7706
q19	1678	1576	1548	1548
q20	2069	1851	1892	1851
q21	5225	5145	5006	5006
q22	1167	1049	1047	1047
Total cold run time: 67774 ms
Total hot run time: 59201 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196210 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 3276ecf31e3e3f4dfa4df9f18a6483557abff622, data reload: false

query1	1282	946	914	914
query2	6173	1904	1868	1868
query3	10926	4628	4586	4586
query4	36600	23435	23179	23179
query5	3630	464	443	443
query6	271	179	184	179
query7	3995	316	315	315
query8	283	224	215	215
query9	9306	2579	2587	2579
query10	477	264	257	257
query11	17882	15099	15242	15099
query12	166	100	102	100
query13	1558	437	450	437
query14	9436	6524	7129	6524
query15	230	186	187	186
query16	7850	516	516	516
query17	1561	591	572	572
query18	2085	319	304	304
query19	343	157	160	157
query20	122	112	115	112
query21	203	101	106	101
query22	4821	4514	4620	4514
query23	35368	34393	34320	34320
query24	12021	2963	2884	2884
query25	653	425	450	425
query26	1455	177	171	171
query27	2700	355	356	355
query28	7416	2183	2156	2156
query29	895	475	461	461
query30	258	160	169	160
query31	1060	810	854	810
query32	82	60	64	60
query33	717	310	296	296
query34	1087	524	541	524
query35	872	713	737	713
query36	1129	961	959	959
query37	135	72	68	68
query38	4075	3895	3917	3895
query39	1552	1527	1499	1499
query40	255	99	113	99
query41	51	51	49	49
query42	114	104	99	99
query43	519	485	484	484
query44	1223	820	860	820
query45	188	170	174	170
query46	1131	748	750	748
query47	2081	1906	1941	1906
query48	468	381	411	381
query49	972	395	404	395
query50	847	442	422	422
query51	7532	7324	7189	7189
query52	107	94	88	88
query53	262	187	182	182
query54	1148	461	469	461
query55	84	79	76	76
query56	263	245	246	245
query57	1303	1219	1186	1186
query58	227	198	205	198
query59	3121	3037	2964	2964
query60	290	269	282	269
query61	112	106	111	106
query62	912	717	695	695
query63	230	196	190	190
query64	4760	663	639	639
query65	3336	3292	3289	3289
query66	1471	311	305	305
query67	16256	15605	15519	15519
query68	4920	576	579	576
query69	435	267	264	264
query70	1135	1055	1105	1055
query71	318	246	246	246
query72	6108	4092	4057	4057
query73	774	361	348	348
query74	10344	9318	8849	8849
query75	3373	2615	2614	2614
query76	1560	1125	979	979
query77	386	268	256	256
query78	10624	9587	9551	9551
query79	1116	594	589	589
query80	787	422	440	422
query81	489	214	212	212
query82	1207	94	91	91
query83	248	144	142	142
query84	237	83	81	81
query85	1054	309	289	289
query86	306	302	276	276
query87	4397	4196	4244	4196
query88	3550	2408	2388	2388
query89	411	285	290	285
query90	2030	184	180	180
query91	181	150	149	149
query92	58	52	49	49
query93	1171	537	543	537
query94	733	294	296	294
query95	354	259	267	259
query96	608	282	279	279
query97	3281	3122	3153	3122
query98	214	196	197	196
query99	1516	1292	1300	1292
Total cold run time: 303863 ms
Total hot run time: 196210 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.06	0.03	0.04
query3	0.24	0.06	0.06
query4	1.63	0.10	0.10
query5	0.50	0.52	0.50
query6	1.13	0.73	0.73
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.56	0.51	0.49
query10	0.54	0.56	0.60
query11	0.13	0.11	0.11
query12	0.13	0.11	0.11
query13	0.61	0.59	0.60
query14	0.77	0.80	0.79
query15	0.85	0.83	0.82
query16	0.38	0.38	0.40
query17	1.07	1.02	1.00
query18	0.24	0.23	0.22
query19	1.97	1.82	1.87
query20	0.01	0.01	0.01
query21	15.39	0.62	0.57
query22	2.64	2.37	1.65
query23	16.75	1.09	0.85
query24	3.03	0.54	1.43
query25	0.23	0.11	0.12
query26	0.49	0.14	0.13
query27	0.04	0.05	0.04
query28	10.56	0.52	0.48
query29	12.57	3.17	3.15
query30	0.25	0.07	0.07
query31	2.89	0.38	0.38
query32	3.25	0.47	0.46
query33	2.97	3.01	3.05
query34	17.13	4.51	4.48
query35	4.55	4.56	4.50
query36	0.69	0.48	0.47
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.03
query40	0.17	0.12	0.12
query41	0.08	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.02	0.02
Total cold run time: 104.83 s
Total hot run time: 29.58 s

@Jibing-Li
Copy link
Contributor Author

run external

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 653dd06 into apache:branch-3.0 Aug 13, 2025
25 of 26 checks passed
@Jibing-Li Jibing-Li deleted the order3.0 branch August 13, 2025 08:37
@gavinchou gavinchou mentioned this pull request Sep 1, 2025
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.

4 participants