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](partition) Incorrectly add partition to non-partitioned table #48121

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

Conversation

wyxxxcat
Copy link
Contributor

@wyxxxcat wyxxxcat commented Feb 20, 2025

What problem does this PR solve?

Issue Number: close #48111

Related PR: #xxx

mysql> CREATE TABLE t (
    ->     id int null,
    ->     k largeint null
    -> )
    -> DISTRIBUTED BY HASH(`k`, `id`) BUCKETS 16
    -> PROPERTIES (
    ->     "replication_num" = "1"
    -> );
Query OK, 0 rows affected (0.03 sec)

mysql> alter table t add partition p1 values in ((1));
Query OK, 0 rows affected (0.03 sec)

mysql> alter table t drop partition p1;
ERROR 1105 (HY000): errCode = 2, detailMessage = Alter table [t] failed. Not a partitioned table

Problem Summary:

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.
  • 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?

@wyxxxcat wyxxxcat force-pushed the add_no_partition branch 2 times, most recently from ffbf6c2 to da086f9 Compare February 20, 2025 03:20
@wyxxxcat
Copy link
Contributor Author

run buildall

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

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17643	5431	5109	5109
q2	2047	308	182	182
q3	10400	1336	757	757
q4	10213	999	526	526
q5	7516	2472	2338	2338
q6	189	169	133	133
q7	914	757	603	603
q8	9302	1346	1163	1163
q9	4814	4574	4730	4574
q10	6819	2302	1874	1874
q11	481	282	268	268
q12	355	355	225	225
q13	17754	3690	3101	3101
q14	229	223	215	215
q15	519	475	445	445
q16	628	602	585	585
q17	605	875	354	354
q18	6785	6220	6317	6220
q19	1075	947	532	532
q20	315	330	201	201
q21	2742	2144	1925	1925
q22	366	334	307	307
Total cold run time: 101711 ms
Total hot run time: 31637 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5208	5147	5170	5147
q2	236	333	238	238
q3	2151	2644	2324	2324
q4	1426	1825	1387	1387
q5	4238	4147	4115	4115
q6	208	164	125	125
q7	1873	1812	1664	1664
q8	2605	2538	2577	2538
q9	7336	7205	7186	7186
q10	3001	3215	2769	2769
q11	586	517	474	474
q12	686	763	607	607
q13	3460	3868	3275	3275
q14	284	289	280	280
q15	509	466	454	454
q16	624	672	634	634
q17	1130	1604	1319	1319
q18	7465	7254	7312	7254
q19	788	815	864	815
q20	1975	2002	1966	1966
q21	5222	4834	4895	4834
q22	609	566	528	528
Total cold run time: 51620 ms
Total hot run time: 49933 ms

@doris-robot
Copy link

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

query1	985	385	387	385
query2	6552	1848	1825	1825
query3	6797	225	215	215
query4	26434	23763	23581	23581
query5	4768	675	502	502
query6	312	199	182	182
query7	4644	520	302	302
query8	311	246	220	220
query9	8651	2517	2542	2517
query10	442	303	251	251
query11	15279	15221	14902	14902
query12	160	106	111	106
query13	1655	505	393	393
query14	9435	6280	6642	6280
query15	204	196	174	174
query16	7357	622	470	470
query17	1158	704	538	538
query18	1843	379	301	301
query19	183	195	159	159
query20	116	114	115	114
query21	210	119	104	104
query22	4181	4344	4358	4344
query23	34418	33589	33000	33000
query24	7678	2406	2400	2400
query25	549	460	416	416
query26	1221	285	157	157
query27	2368	511	332	332
query28	4125	2428	2396	2396
query29	755	552	449	449
query30	240	189	156	156
query31	929	907	777	777
query32	79	66	68	66
query33	565	355	317	317
query34	770	842	566	566
query35	805	803	725	725
query36	956	985	909	909
query37	116	97	76	76
query38	4275	4052	4129	4052
query39	1511	1391	1402	1391
query40	211	116	99	99
query41	53	53	104	53
query42	121	107	104	104
query43	491	498	477	477
query44	1287	800	790	790
query45	177	170	160	160
query46	867	1024	661	661
query47	1784	1780	1673	1673
query48	390	400	308	308
query49	782	511	391	391
query50	685	743	423	423
query51	4222	4230	4092	4092
query52	109	111	94	94
query53	239	269	181	181
query54	475	486	409	409
query55	82	82	80	80
query56	266	268	244	244
query57	1133	1123	1052	1052
query58	250	234	239	234
query59	2582	2612	2767	2612
query60	288	274	283	274
query61	141	123	118	118
query62	785	726	671	671
query63	242	188	191	188
query64	4301	991	639	639
query65	3257	3126	3141	3126
query66	1109	397	287	287
query67	15912	15446	15488	15446
query68	7900	779	522	522
query69	462	305	265	265
query70	1167	1154	1068	1068
query71	399	297	272	272
query72	5642	3654	3701	3654
query73	694	746	359	359
query74	9245	9004	8897	8897
query75	3123	3227	2674	2674
query76	3262	1164	731	731
query77	500	387	291	291
query78	10007	9906	9248	9248
query79	2975	822	611	611
query80	759	528	479	479
query81	504	277	239	239
query82	713	126	98	98
query83	184	180	164	164
query84	250	96	74	74
query85	855	344	301	301
query86	384	316	285	285
query87	4478	4558	4409	4409
query88	4171	2213	2205	2205
query89	412	322	286	286
query90	1870	194	195	194
query91	139	154	107	107
query92	80	62	57	57
query93	2198	1016	585	585
query94	705	392	309	309
query95	353	269	255	255
query96	516	546	277	277
query97	2788	2859	2780	2780
query98	228	208	212	208
query99	1429	1386	1262	1262
Total cold run time: 273670 ms
Total hot run time: 184102 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.06	0.04	0.03
query3	0.23	0.07	0.07
query4	1.62	0.10	0.10
query5	0.41	0.41	0.40
query6	1.18	0.66	0.65
query7	0.03	0.01	0.01
query8	0.04	0.03	0.04
query9	0.59	0.53	0.53
query10	0.57	0.57	0.57
query11	0.16	0.11	0.10
query12	0.15	0.12	0.12
query13	0.62	0.59	0.60
query14	2.69	2.71	2.71
query15	0.93	0.86	0.84
query16	0.38	0.38	0.37
query17	0.99	1.04	1.06
query18	0.22	0.20	0.20
query19	1.89	1.97	1.99
query20	0.02	0.01	0.02
query21	15.34	0.88	0.55
query22	0.74	1.16	0.65
query23	15.01	1.39	0.66
query24	10.72	1.66	0.35
query25	0.31	0.11	0.13
query26	0.90	0.19	0.13
query27	0.05	0.05	0.04
query28	6.24	0.82	0.43
query29	12.53	3.94	3.27
query30	0.26	0.08	0.06
query31	2.84	0.60	0.39
query32	3.23	0.55	0.46
query33	2.97	3.00	3.11
query34	15.79	5.12	4.54
query35	4.55	4.54	4.59
query36	0.68	0.49	0.48
query37	0.09	0.07	0.07
query38	0.05	0.05	0.04
query39	0.03	0.02	0.02
query40	0.17	0.13	0.13
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 105.47 s
Total hot run time: 30.36 s

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Feb 20, 2025
@wyxxxcat
Copy link
Contributor Author

run buildall

@wyxxxcat
Copy link
Contributor Author

run buildall

@wyxxxcat
Copy link
Contributor Author

run feut

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17763	5461	5127	5127
q2	2057	294	178	178
q3	10756	1224	772	772
q4	10202	1022	532	532
q5	7519	2488	2287	2287
q6	189	168	139	139
q7	929	764	600	600
q8	9447	1347	1118	1118
q9	5353	4728	4800	4728
q10	6954	2334	1898	1898
q11	489	276	259	259
q12	364	362	223	223
q13	18621	3859	3269	3269
q14	235	233	215	215
q15	522	467	471	467
q16	628	622	584	584
q17	594	876	364	364
q18	6802	6517	6641	6517
q19	2891	1014	579	579
q20	339	336	200	200
q21	2909	2221	2009	2009
q22	392	371	338	338
Total cold run time: 105955 ms
Total hot run time: 32403 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5079	5128	5122	5122
q2	248	345	242	242
q3	2225	2669	2277	2277
q4	1479	1814	1399	1399
q5	4240	4142	4197	4142
q6	213	176	134	134
q7	1964	1893	1743	1743
q8	2599	2566	2527	2527
q9	7218	7091	7164	7091
q10	3062	3223	2774	2774
q11	568	525	498	498
q12	676	727	604	604
q13	3572	3909	3353	3353
q14	299	293	272	272
q15	497	476	460	460
q16	649	679	626	626
q17	1140	1630	1308	1308
q18	7603	7272	7259	7259
q19	848	909	1045	909
q20	1967	2032	1878	1878
q21	5570	4998	4791	4791
q22	657	576	560	560
Total cold run time: 52373 ms
Total hot run time: 49969 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 190811 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 0e3293e53296eb54313b56435d8c9faa47c884cd, data reload: false

query1	1328	961	953	953
query2	6092	1836	1889	1836
query3	11095	4479	4760	4479
query4	56997	25977	23327	23327
query5	5159	526	486	486
query6	393	215	190	190
query7	5251	506	299	299
query8	339	248	230	230
query9	6886	2573	2576	2573
query10	444	304	246	246
query11	15261	15118	14951	14951
query12	160	104	104	104
query13	1199	523	425	425
query14	10570	6810	6715	6715
query15	188	199	187	187
query16	7085	672	522	522
query17	1095	735	595	595
query18	1503	417	330	330
query19	201	229	171	171
query20	130	120	117	117
query21	211	123	113	113
query22	4340	4467	4304	4304
query23	33852	33363	33573	33363
query24	5643	2423	2421	2421
query25	457	471	396	396
query26	728	281	157	157
query27	1820	502	328	328
query28	2838	2491	2453	2453
query29	561	570	422	422
query30	207	200	162	162
query31	896	889	819	819
query32	78	64	59	59
query33	462	362	312	312
query34	752	883	530	530
query35	796	831	772	772
query36	975	967	914	914
query37	119	98	72	72
query38	4306	4408	4381	4381
query39	1490	1449	1441	1441
query40	212	120	106	106
query41	53	53	49	49
query42	125	105	124	105
query43	497	512	501	501
query44	1334	820	796	796
query45	182	182	171	171
query46	896	1053	660	660
query47	1846	1856	1788	1788
query48	398	433	319	319
query49	705	515	419	419
query50	712	774	417	417
query51	4278	4368	4206	4206
query52	105	115	107	107
query53	227	263	183	183
query54	468	496	437	437
query55	78	75	77	75
query56	282	276	252	252
query57	1158	1198	1136	1136
query58	253	258	241	241
query59	2812	2938	2934	2934
query60	292	289	275	275
query61	124	114	115	114
query62	716	774	687	687
query63	236	198	189	189
query64	1668	1055	654	654
query65	3213	3149	3168	3149
query66	727	389	303	303
query67	15901	15665	15217	15217
query68	5277	775	505	505
query69	538	306	272	272
query70	1230	1107	1101	1101
query71	458	292	275	275
query72	5912	3643	3748	3643
query73	963	745	350	350
query74	9151	9144	8755	8755
query75	3439	3143	2657	2657
query76	3684	1173	787	787
query77	537	366	296	296
query78	10062	10133	9318	9318
query79	2119	846	607	607
query80	601	547	440	440
query81	503	269	232	232
query82	283	135	102	102
query83	181	169	149	149
query84	294	94	77	77
query85	827	351	310	310
query86	424	317	298	298
query87	4420	4453	4474	4453
query88	3808	2231	2230	2230
query89	415	319	290	290
query90	1904	194	199	194
query91	133	146	107	107
query92	79	65	59	59
query93	1747	1007	577	577
query94	619	401	307	307
query95	362	274	258	258
query96	511	576	286	286
query97	2794	2823	2759	2759
query98	225	206	220	206
query99	1313	1422	1266	1266
Total cold run time: 296218 ms
Total hot run time: 190811 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.08	0.03	0.03
query3	0.24	0.07	0.07
query4	1.62	0.10	0.10
query5	0.41	0.41	0.41
query6	1.19	0.65	0.67
query7	0.02	0.02	0.02
query8	0.04	0.04	0.04
query9	0.60	0.53	0.51
query10	0.56	0.58	0.56
query11	0.15	0.10	0.10
query12	0.14	0.11	0.11
query13	0.62	0.60	0.60
query14	2.72	2.76	2.74
query15	0.94	0.84	0.86
query16	0.37	0.38	0.37
query17	1.01	0.99	1.04
query18	0.21	0.20	0.20
query19	1.95	1.74	1.96
query20	0.01	0.01	0.01
query21	15.34	0.93	0.56
query22	0.76	1.20	0.79
query23	14.74	1.42	0.63
query24	6.87	0.90	1.81
query25	0.55	0.23	0.13
query26	0.46	0.15	0.14
query27	0.06	0.06	0.05
query28	10.57	0.88	0.44
query29	12.57	4.08	3.32
query30	0.25	0.09	0.06
query31	2.83	0.59	0.39
query32	3.21	0.55	0.46
query33	2.97	3.02	3.02
query34	15.80	5.18	4.52
query35	4.56	4.54	4.52
query36	0.68	0.50	0.49
query37	0.09	0.06	0.06
query38	0.06	0.04	0.03
query39	0.03	0.02	0.02
query40	0.18	0.13	0.12
query41	0.09	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 105.65 s
Total hot run time: 30.83 s

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.

[Bug] Add partition to a no-partition table
5 participants