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

branch-3.0: [fix](partition) Add partition of mismatched type to table #47200 #47446

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

Conversation

github-actions[bot]
Copy link
Contributor

Cherry-picked from #47200

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

mysql> ALTER TABLE t ADD PARTITION p_0_2 VALUES [("0"), ("2"));
ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke "java.util.List.iterator()" because the return value of "org.apache.doris.analysis.PartitionKeyDesc.getInValues()" is null
```
now
```
mysql> ALTER TABLE t ADD PARTITION p_0_2 VALUES [("0"), ("2"));
ERROR 1105 (HY000): errCode = 2, detailMessage = List partition expected 'VALUES [IN or ((\"xxx\", \"xxx\"), ...)]'
```
before
```
mysql> CREATE TABLE t (
    ->     id int null,
    ->     k largeint null
    -> )
    -> PARTITION BY RANGE (`id`, `k`)
    -> (
    -> )
    -> DISTRIBUTED BY HASH(`k`) BUCKETS 16
    -> PROPERTIES (
    ->     "replication_num" = "1"
    -> );
Query OK, 0 rows affected (0.05 sec)

mysql> ALTER TABLE t ADD PARTITION p_0_2 VALUES IN (("0", "2"));
ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke "java.util.List.size()" because "keys" is null
```
now
```
mysql> ALTER TABLE t ADD PARTITION p_0_2 VALUES IN (("0", "2"));
ERROR 1105 (HY000): errCode = 2, detailMessage = Range partition expected 'VALUES [LESS THAN or [(\"xxx\" ,...), (\"xxx\", ...))]'
```
@github-actions github-actions bot requested a review from dataroaring as a code owner January 26, 2025 02:07
@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?

@dataroaring dataroaring reopened this Jan 26, 2025
@hello-stephen
Copy link
Contributor

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17611	7760	7292	7292
q2	2067	168	167	167
q3	10664	1152	1250	1152
q4	10576	796	723	723
q5	7843	2862	2899	2862
q6	244	150	146	146
q7	1005	621	625	621
q8	9805	2021	2034	2021
q9	6840	6536	6547	6536
q10	7684	2318	2367	2318
q11	481	268	266	266
q12	405	210	208	208
q13	17798	2988	3016	2988
q14	235	207	215	207
q15	573	523	527	523
q16	671	585	599	585
q17	982	608	625	608
q18	7350	6695	6830	6695
q19	1390	1074	1074	1074
q20	480	212	196	196
q21	4106	3274	3103	3103
q22	1109	1031	1008	1008
Total cold run time: 109919 ms
Total hot run time: 41299 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7301	7244	7243	7243
q2	332	230	230	230
q3	3178	2985	2920	2920
q4	2080	1850	1833	1833
q5	5712	5754	5727	5727
q6	218	136	140	136
q7	2248	1818	1759	1759
q8	3317	3530	3455	3455
q9	8897	8815	9085	8815
q10	3637	3557	3597	3557
q11	597	505	502	502
q12	813	642	625	625
q13	3928	3252	3261	3252
q14	319	290	289	289
q15	575	548	526	526
q16	694	649	657	649
q17	1874	1609	1569	1569
q18	8394	7780	7442	7442
q19	1646	1482	1488	1482
q20	2055	1808	1798	1798
q21	5438	5226	5258	5226
q22	1116	1036	1007	1007
Total cold run time: 64369 ms
Total hot run time: 60042 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191920 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 3edf6bdf0f5351652093b7c013b311eda7d65671, data reload: false

query1	993	373	395	373
query2	6526	2084	2032	2032
query3	6703	211	223	211
query4	33939	23692	23437	23437
query5	4392	456	443	443
query6	270	172	200	172
query7	4611	311	317	311
query8	275	210	213	210
query9	9543	2698	2690	2690
query10	493	253	262	253
query11	18080	15181	15441	15181
query12	155	104	102	102
query13	1632	443	417	417
query14	8749	7231	7028	7028
query15	254	176	181	176
query16	8108	471	481	471
query17	1639	598	569	569
query18	2136	310	313	310
query19	258	160	164	160
query20	119	109	108	108
query21	214	107	108	107
query22	4406	4528	4289	4289
query23	34811	34063	34029	34029
query24	11560	2877	2818	2818
query25	708	395	395	395
query26	1865	164	169	164
query27	2914	349	338	338
query28	8023	2420	2402	2402
query29	1064	446	427	427
query30	339	169	156	156
query31	1018	792	798	792
query32	98	58	59	58
query33	800	301	301	301
query34	942	507	544	507
query35	840	694	718	694
query36	1128	961	964	961
query37	190	73	72	72
query38	3964	3918	3909	3909
query39	1490	1455	1429	1429
query40	281	99	98	98
query41	51	49	49	49
query42	113	102	102	102
query43	545	493	459	459
query44	1297	818	807	807
query45	183	164	167	164
query46	1153	734	695	695
query47	1945	1841	1836	1836
query48	476	392	383	383
query49	1277	393	391	391
query50	811	405	406	405
query51	7256	7090	7244	7090
query52	105	91	93	91
query53	259	186	188	186
query54	1230	470	468	468
query55	83	79	76	76
query56	265	251	248	248
query57	1208	1131	1077	1077
query58	238	211	220	211
query59	3151	2840	2963	2840
query60	286	261	255	255
query61	114	112	112	112
query62	868	711	667	667
query63	223	189	188	188
query64	5140	724	697	697
query65	3264	3203	3189	3189
query66	1430	309	317	309
query67	15893	15549	15616	15549
query68	3274	581	601	581
query69	410	279	282	279
query70	1170	1077	1087	1077
query71	318	261	253	253
query72	6126	4010	4051	4010
query73	770	351	361	351
query74	9947	9000	8968	8968
query75	3348	2653	2651	2651
query76	1981	1141	1152	1141
query77	427	276	273	273
query78	10387	9725	9657	9657
query79	1082	620	603	603
query80	624	442	440	440
query81	473	238	235	235
query82	215	122	116	116
query83	161	148	153	148
query84	236	79	78	78
query85	728	302	292	292
query86	338	310	299	299
query87	4418	4359	4257	4257
query88	3810	2392	2348	2348
query89	391	289	298	289
query90	1994	187	191	187
query91	187	153	150	150
query92	59	51	51	51
query93	1036	568	555	555
query94	765	308	302	302
query95	354	251	258	251
query96	621	282	283	282
query97	3283	3191	3163	3163
query98	221	197	192	192
query99	1482	1297	1305	1297
Total cold run time: 295030 ms
Total hot run time: 191920 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.06	0.03	0.03
query3	0.23	0.07	0.07
query4	1.63	0.10	0.10
query5	0.52	0.52	0.52
query6	1.13	0.73	0.73
query7	0.02	0.02	0.02
query8	0.04	0.03	0.05
query9	0.56	0.50	0.49
query10	0.55	0.55	0.56
query11	0.14	0.11	0.10
query12	0.14	0.11	0.11
query13	0.61	0.59	0.60
query14	2.80	2.73	2.74
query15	0.91	0.82	0.83
query16	0.37	0.38	0.38
query17	0.99	1.06	1.02
query18	0.24	0.21	0.22
query19	1.89	1.85	2.02
query20	0.01	0.00	0.01
query21	15.38	0.60	0.58
query22	2.77	2.58	1.01
query23	16.91	0.98	0.86
query24	2.76	1.08	2.19
query25	0.40	0.11	0.05
query26	0.51	0.13	0.14
query27	0.04	0.06	0.04
query28	9.82	1.15	1.09
query29	12.62	3.29	3.24
query30	0.25	0.06	0.06
query31	2.86	0.39	0.39
query32	3.23	0.47	0.47
query33	3.01	3.04	3.03
query34	16.87	4.57	4.49
query35	4.64	4.51	4.51
query36	0.71	0.51	0.50
query37	0.09	0.06	0.07
query38	0.04	0.03	0.04
query39	0.04	0.02	0.02
query40	0.15	0.12	0.13
query41	0.07	0.02	0.03
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 106.1 s
Total hot run time: 32.21 s

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