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](schema change) Fix NPE when rename column on table which has sequence type column #46906

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

bobhan1
Copy link
Contributor

@bobhan1 bobhan1 commented Jan 13, 2025

What problem does this PR solve?

Problem Summary:

CREATE TABLE `tbl` (
  `c` tinyint NULL,
) ENGINE=OLAP
UNIQUE KEY(`c`)
DISTRIBUTED BY HASH(`c`) BUCKETS 10
PROPERTIES (
  "function_column.sequence_type" = "bigint"
);

mysql> alter table tbl rename column c c_bk;                                                         
ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "org.apache.doris.catalog.OlapTable.getSequenceMapCol()" is null

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?

@bobhan1
Copy link
Contributor Author

bobhan1 commented Jan 13, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17640	6198	6090	6090
q2	2050	317	172	172
q3	10398	1228	721	721
q4	10197	865	439	439
q5	7537	2189	1997	1997
q6	207	179	148	148
q7	900	755	601	601
q8	9225	1319	1127	1127
q9	5156	4856	4863	4856
q10	6756	2290	1857	1857
q11	458	278	257	257
q12	347	359	224	224
q13	17757	3660	3069	3069
q14	229	226	216	216
q15	558	489	517	489
q16	642	626	603	603
q17	560	853	323	323
q18	7211	6482	6466	6466
q19	1212	966	540	540
q20	312	331	193	193
q21	2875	2173	1982	1982
q22	378	346	316	316
Total cold run time: 102605 ms
Total hot run time: 32686 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6270	6232	6266	6232
q2	244	352	234	234
q3	2255	2675	2342	2342
q4	1469	1796	1350	1350
q5	4366	4755	4776	4755
q6	193	191	146	146
q7	2101	2004	1845	1845
q8	2644	2756	2680	2680
q9	7126	7137	7106	7106
q10	3034	3356	2798	2798
q11	591	536	501	501
q12	707	778	615	615
q13	3427	3834	3270	3270
q14	278	288	272	272
q15	561	512	495	495
q16	683	714	642	642
q17	1199	1713	1256	1256
q18	7628	7597	6912	6912
q19	777	1091	1035	1035
q20	1927	1926	1843	1843
q21	5502	5159	4835	4835
q22	620	625	566	566
Total cold run time: 53602 ms
Total hot run time: 51730 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187512 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 469f5e03e30d89159b4c608c6298b08ddb1d0c1d, data reload: false

query1	981	381	394	381
query2	6537	2385	2225	2225
query3	6715	223	211	211
query4	33736	23488	23235	23235
query5	4375	645	467	467
query6	306	194	191	191
query7	4615	503	303	303
query8	302	244	237	237
query9	9512	2694	2700	2694
query10	485	324	260	260
query11	18523	15469	15151	15151
query12	161	109	103	103
query13	1654	524	400	400
query14	10068	7203	6542	6542
query15	250	206	192	192
query16	7753	618	441	441
query17	1602	738	568	568
query18	2089	382	293	293
query19	227	176	152	152
query20	126	115	114	114
query21	210	119	96	96
query22	4131	4262	4231	4231
query23	34909	33090	33073	33073
query24	6674	2295	2253	2253
query25	471	431	380	380
query26	1103	250	156	156
query27	2217	460	335	335
query28	5244	2436	2415	2415
query29	550	509	411	411
query30	233	185	156	156
query31	948	856	791	791
query32	87	67	64	64
query33	512	350	308	308
query34	749	865	512	512
query35	785	831	725	725
query36	1014	1050	944	944
query37	130	108	71	71
query38	3989	4159	3913	3913
query39	1459	1431	1425	1425
query40	200	116	99	99
query41	51	51	49	49
query42	123	106	123	106
query43	517	540	480	480
query44	1396	805	798	798
query45	180	171	174	171
query46	847	1065	634	634
query47	1804	1832	1753	1753
query48	382	405	312	312
query49	781	511	408	408
query50	628	655	372	372
query51	7023	6920	6704	6704
query52	103	103	94	94
query53	232	254	187	187
query54	478	491	411	411
query55	86	83	81	81
query56	265	251	272	251
query57	1158	1152	1107	1107
query58	257	226	237	226
query59	2945	3026	2909	2909
query60	273	260	247	247
query61	130	116	123	116
query62	827	746	721	721
query63	229	192	187	187
query64	4468	1056	648	648
query65	3229	3124	3188	3124
query66	1034	434	317	317
query67	15754	15814	15352	15352
query68	7674	708	518	518
query69	482	296	274	274
query70	1219	1123	1104	1104
query71	459	295	309	295
query72	6098	3853	3799	3799
query73	662	759	354	354
query74	10270	8846	8865	8846
query75	4095	3176	2646	2646
query76	3706	1155	766	766
query77	803	393	277	277
query78	10073	10004	9346	9346
query79	2944	830	596	596
query80	674	542	442	442
query81	474	271	237	237
query82	653	150	120	120
query83	166	183	149	149
query84	230	91	75	75
query85	773	359	333	333
query86	356	318	302	302
query87	4509	4279	4427	4279
query88	4475	2159	2117	2117
query89	407	327	293	293
query90	1888	203	190	190
query91	137	138	106	106
query92	72	59	56	56
query93	1450	879	542	542
query94	665	405	303	303
query95	342	272	280	272
query96	485	627	276	276
query97	2811	2956	2762	2762
query98	232	210	196	196
query99	1590	1509	1358	1358
Total cold run time: 291706 ms
Total hot run time: 187512 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.23	0.07	0.07
query4	1.61	0.10	0.10
query5	0.43	0.41	0.41
query6	1.18	0.65	0.67
query7	0.03	0.02	0.01
query8	0.04	0.03	0.03
query9	0.57	0.53	0.49
query10	0.55	0.57	0.53
query11	0.15	0.10	0.11
query12	0.14	0.10	0.10
query13	0.61	0.59	0.61
query14	2.82	2.85	2.80
query15	0.89	0.82	0.81
query16	0.38	0.37	0.40
query17	1.05	0.99	1.00
query18	0.23	0.21	0.21
query19	1.84	1.78	1.99
query20	0.02	0.01	0.02
query21	15.36	0.91	0.59
query22	0.76	0.83	0.66
query23	15.18	1.44	0.56
query24	3.00	1.61	0.96
query25	0.30	0.15	0.10
query26	0.23	0.15	0.14
query27	0.05	0.06	0.05
query28	14.01	1.52	1.05
query29	12.58	4.11	3.40
query30	0.24	0.09	0.07
query31	2.82	0.58	0.38
query32	3.23	0.55	0.45
query33	3.05	3.07	3.13
query34	16.79	5.15	4.51
query35	4.52	4.50	4.50
query36	0.63	0.48	0.47
query37	0.10	0.06	0.05
query38	0.04	0.04	0.03
query39	0.03	0.02	0.03
query40	0.18	0.13	0.12
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.04
Total cold run time: 106.14 s
Total hot run time: 31.36 s

@dataroaring
Copy link
Contributor

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17602	6147	6065	6065
q2	2064	307	170	170
q3	10413	1229	723	723
q4	10215	874	438	438
q5	7533	2151	1963	1963
q6	204	179	148	148
q7	905	779	605	605
q8	9226	1317	1215	1215
q9	5283	4834	4898	4834
q10	6750	2288	1835	1835
q11	496	282	261	261
q12	344	393	225	225
q13	17778	3699	3087	3087
q14	246	237	209	209
q15	576	515	500	500
q16	617	632	578	578
q17	565	843	331	331
q18	7187	6351	6510	6351
q19	1211	948	542	542
q20	329	334	205	205
q21	3050	2213	2064	2064
q22	382	336	308	308
Total cold run time: 102976 ms
Total hot run time: 32657 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6204	6209	6165	6165
q2	244	326	240	240
q3	2240	2650	2354	2354
q4	1410	1805	1415	1415
q5	4301	4749	4785	4749
q6	184	177	145	145
q7	2141	1972	1835	1835
q8	2634	2772	2667	2667
q9	7137	7080	7177	7080
q10	3002	3303	2827	2827
q11	607	526	499	499
q12	694	761	651	651
q13	3519	3835	3155	3155
q14	285	310	291	291
q15	569	509	521	509
q16	643	704	658	658
q17	1206	1738	1283	1283
q18	7688	7396	7098	7098
q19	810	895	1137	895
q20	1951	1957	1894	1894
q21	5530	5060	4809	4809
q22	620	603	576	576
Total cold run time: 53619 ms
Total hot run time: 51795 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188339 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 714840cd371fe1117065525d5e37e8fb35462d61, data reload: false

query1	1000	374	370	370
query2	6523	2433	2342	2342
query3	6709	225	224	224
query4	33430	23699	23501	23501
query5	4353	619	460	460
query6	303	209	189	189
query7	4621	486	304	304
query8	303	239	216	216
query9	9640	2679	2664	2664
query10	474	308	258	258
query11	18152	15292	15164	15164
query12	157	108	104	104
query13	1667	525	390	390
query14	9625	7226	6915	6915
query15	250	194	204	194
query16	7882	606	435	435
query17	1603	763	539	539
query18	1856	372	300	300
query19	216	177	151	151
query20	119	111	110	110
query21	217	130	99	99
query22	4209	4109	4266	4109
query23	34775	32779	33004	32779
query24	6696	2229	2245	2229
query25	469	447	380	380
query26	1117	252	159	159
query27	2036	454	329	329
query28	5322	2438	2383	2383
query29	533	523	419	419
query30	229	198	156	156
query31	941	840	792	792
query32	85	59	64	59
query33	519	366	305	305
query34	742	842	523	523
query35	834	780	743	743
query36	1004	1013	950	950
query37	136	103	81	81
query38	4179	4155	4020	4020
query39	1492	1417	1407	1407
query40	204	119	101	101
query41	53	55	48	48
query42	130	101	101	101
query43	520	535	494	494
query44	1313	833	805	805
query45	183	174	167	167
query46	843	1039	672	672
query47	1770	1819	1737	1737
query48	364	383	316	316
query49	788	482	395	395
query50	612	636	389	389
query51	6913	6949	6790	6790
query52	103	107	95	95
query53	217	248	184	184
query54	492	487	408	408
query55	79	81	81	81
query56	265	271	250	250
query57	1162	1155	1089	1089
query58	250	251	258	251
query59	3116	3209	3108	3108
query60	313	264	272	264
query61	120	116	116	116
query62	855	769	692	692
query63	227	193	183	183
query64	4381	1026	667	667
query65	3244	3172	3200	3172
query66	1071	419	312	312
query67	15828	15740	15330	15330
query68	7360	710	515	515
query69	461	294	263	263
query70	1223	1164	1073	1073
query71	449	306	267	267
query72	6335	3806	3810	3806
query73	645	739	367	367
query74	10409	9064	8838	8838
query75	3970	3132	2660	2660
query76	3619	1195	780	780
query77	791	379	375	375
query78	9960	9868	9320	9320
query79	3210	817	600	600
query80	676	543	450	450
query81	512	279	238	238
query82	658	157	123	123
query83	201	173	156	156
query84	271	88	70	70
query85	762	397	310	310
query86	387	322	303	303
query87	4371	4369	4356	4356
query88	4768	2262	2144	2144
query89	409	333	294	294
query90	1878	194	193	193
query91	141	138	110	110
query92	73	58	61	58
query93	1901	887	538	538
query94	649	386	263	263
query95	336	284	256	256
query96	473	614	278	278
query97	2806	2938	2797	2797
query98	231	203	194	194
query99	1608	1500	1375	1375
Total cold run time: 291377 ms
Total hot run time: 188339 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.03	0.03
query3	0.24	0.08	0.07
query4	1.59	0.11	0.10
query5	0.43	0.40	0.40
query6	1.14	0.66	0.64
query7	0.02	0.02	0.01
query8	0.04	0.04	0.03
query9	0.56	0.50	0.50
query10	0.56	0.56	0.54
query11	0.14	0.10	0.10
query12	0.14	0.11	0.11
query13	0.61	0.61	0.59
query14	2.72	2.82	2.83
query15	0.90	0.83	0.84
query16	0.39	0.38	0.40
query17	1.05	1.06	1.06
query18	0.23	0.20	0.21
query19	1.99	1.87	2.01
query20	0.01	0.01	0.01
query21	15.36	0.97	0.59
query22	0.76	0.80	0.60
query23	15.34	1.37	0.61
query24	2.68	1.42	0.93
query25	0.11	0.15	0.08
query26	0.32	0.14	0.15
query27	0.07	0.05	0.07
query28	13.95	1.52	1.04
query29	12.58	4.04	3.40
query30	0.24	0.09	0.08
query31	2.81	0.62	0.38
query32	3.23	0.55	0.47
query33	3.08	3.06	3.11
query34	16.98	5.08	4.44
query35	4.50	4.44	4.46
query36	0.65	0.49	0.50
query37	0.10	0.07	0.06
query38	0.04	0.03	0.03
query39	0.04	0.03	0.03
query40	0.18	0.13	0.12
query41	0.08	0.03	0.02
query42	0.04	0.02	0.03
query43	0.03	0.03	0.03
Total cold run time: 106.04 s
Total hot run time: 31.43 s

Copy link
Contributor

@zhannngchen zhannngchen left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 14, 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.

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 9a324bc into apache:master Jan 14, 2025
29 of 30 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 14, 2025
…quence type column (#46906)

### What problem does this PR solve?
Problem Summary:
```mysql
CREATE TABLE `tbl` (
  `c` tinyint NULL,
) ENGINE=OLAP
UNIQUE KEY(`c`)
DISTRIBUTED BY HASH(`c`) BUCKETS 10
PROPERTIES (
  "function_column.sequence_type" = "bigint"
);

mysql> alter table tbl rename column c c_bk;                                                         
ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "org.apache.doris.catalog.OlapTable.getSequenceMapCol()" is null
```
@dataroaring dataroaring added the usercase Important user case type label label Jan 14, 2025
bobhan1 added a commit to bobhan1/doris that referenced this pull request Jan 14, 2025
…quence type column (apache#46906)

### What problem does this PR solve?
Problem Summary:
```mysql
CREATE TABLE `tbl` (
  `c` tinyint NULL,
) ENGINE=OLAP
UNIQUE KEY(`c`)
DISTRIBUTED BY HASH(`c`) BUCKETS 10
PROPERTIES (
  "function_column.sequence_type" = "bigint"
);

mysql> alter table tbl rename column c c_bk;                                                         
ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "org.apache.doris.catalog.OlapTable.getSequenceMapCol()" is null
```
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. dev/3.0.x reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants