Skip to content

Conversation

@eldenmoon
Copy link
Member

  1. fix the row store columns comparison logic in SchemaChangeHandler. The tests verify the correct behavior when comparing row store columns during ALTER TABLE operations
  2. fix partial columns when meet delete sign

These tests ensure that the system correctly determines when schema changes are needed when users modify row store column properties through ALTER TABLE statements.

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

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

1. fix the row store columns comparison logic in SchemaChangeHandler.
The tests verify the correct behavior when comparing row store columns during ALTER TABLE operations
2. fix partial columns when meet delete sign

These tests ensure that the system correctly determines when schema changes are needed
when users modify row store column properties through ALTER TABLE statements.
@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?

@eldenmoon
Copy link
Member Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26074	5149	5159	5149
q2	2054	291	169	169
q3	10427	1263	738	738
q4	10236	1022	536	536
q5	7547	2425	2387	2387
q6	192	169	137	137
q7	918	741	621	621
q8	9330	1321	1163	1163
q9	6846	5181	5168	5168
q10	6815	2304	1917	1917
q11	492	298	272	272
q12	354	357	225	225
q13	17747	3667	3051	3051
q14	232	241	211	211
q15	542	508	509	508
q16	642	601	594	594
q17	569	878	351	351
q18	7505	7316	7225	7225
q19	1217	977	571	571
q20	321	347	192	192
q21	3916	3382	2487	2487
q22	1086	990	964	964
Total cold run time: 115062 ms
Total hot run time: 34636 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5224	5490	5159	5159
q2	244	332	226	226
q3	2144	2683	2253	2253
q4	1429	1889	1505	1505
q5	4549	4487	4407	4407
q6	212	164	128	128
q7	1987	1968	1769	1769
q8	2600	2680	2592	2592
q9	7200	7138	7172	7138
q10	3038	3194	2743	2743
q11	584	513	485	485
q12	696	759	616	616
q13	3545	3938	3261	3261
q14	286	304	270	270
q15	545	491	507	491
q16	673	696	638	638
q17	1206	1562	1417	1417
q18	7721	7605	7453	7453
q19	869	931	949	931
q20	2003	2052	1910	1910
q21	5111	4610	4729	4610
q22	1060	1042	979	979
Total cold run time: 52926 ms
Total hot run time: 50981 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186198 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 20ca7c97b89f2418285554e9e1a53944ad489ed3, data reload: false

query1	1002	474	469	469
query2	6540	1961	1962	1961
query3	6799	221	214	214
query4	26693	23717	22892	22892
query5	4873	654	456	456
query6	290	194	182	182
query7	4605	473	264	264
query8	277	234	218	218
query9	8699	2555	2538	2538
query10	478	307	251	251
query11	15853	15123	14908	14908
query12	163	112	107	107
query13	1655	513	404	404
query14	9922	6087	6225	6087
query15	212	187	168	168
query16	7649	658	479	479
query17	1159	716	564	564
query18	2011	399	317	317
query19	187	191	154	154
query20	121	117	119	117
query21	215	123	103	103
query22	4184	4082	4374	4082
query23	33808	33283	33054	33054
query24	8315	2415	2386	2386
query25	535	492	417	417
query26	1227	266	148	148
query27	2732	502	324	324
query28	4327	2455	2387	2387
query29	702	571	455	455
query30	283	222	183	183
query31	933	864	761	761
query32	71	71	62	62
query33	549	388	331	331
query34	780	833	499	499
query35	818	815	748	748
query36	961	983	898	898
query37	120	103	79	79
query38	4023	4282	4055	4055
query39	1436	1397	1415	1397
query40	213	116	104	104
query41	57	54	54	54
query42	116	105	107	105
query43	514	499	468	468
query44	1337	811	799	799
query45	173	170	167	167
query46	854	1035	646	646
query47	1785	1836	1758	1758
query48	373	410	297	297
query49	777	540	403	403
query50	686	725	411	411
query51	4173	4181	4189	4181
query52	109	109	106	106
query53	228	250	178	178
query54	485	487	410	410
query55	81	83	79	79
query56	273	263	263	263
query57	1167	1135	1089	1089
query58	241	233	242	233
query59	2584	2784	2762	2762
query60	273	294	263	263
query61	132	126	124	124
query62	803	716	660	660
query63	220	183	187	183
query64	4265	996	674	674
query65	4389	4256	4242	4242
query66	1057	405	302	302
query67	15992	15622	15427	15427
query68	9193	892	510	510
query69	460	290	263	263
query70	1221	1158	1103	1103
query71	440	298	266	266
query72	5329	4705	4728	4705
query73	713	629	347	347
query74	9138	9105	8902	8902
query75	4350	3229	2726	2726
query76	3805	1197	746	746
query77	1047	360	283	283
query78	9969	10310	9333	9333
query79	1083	820	566	566
query80	608	525	459	459
query81	470	262	224	224
query82	295	125	100	100
query83	239	178	163	163
query84	245	93	77	77
query85	754	353	310	310
query86	343	303	276	276
query87	4508	4428	4401	4401
query88	2892	2246	2255	2246
query89	420	318	285	285
query90	2098	210	211	210
query91	139	144	109	109
query92	78	68	55	55
query93	1110	1080	589	589
query94	659	408	303	303
query95	358	270	261	261
query96	486	573	274	274
query97	3153	3261	3096	3096
query98	222	211	201	201
query99	1427	1397	1302	1302
Total cold run time: 275816 ms
Total hot run time: 186198 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.12	0.11	0.11
query3	0.24	0.19	0.19
query4	1.60	0.19	0.19
query5	0.59	0.59	0.59
query6	1.22	0.73	0.71
query7	0.03	0.02	0.01
query8	0.04	0.03	0.03
query9	0.57	0.53	0.52
query10	0.58	0.58	0.57
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.62	0.60	0.60
query14	2.80	2.78	2.70
query15	0.93	0.84	0.84
query16	0.39	0.38	0.38
query17	1.01	1.01	1.01
query18	0.21	0.20	0.19
query19	1.90	1.91	1.87
query20	0.01	0.02	0.01
query21	15.35	0.91	0.56
query22	0.74	1.19	0.75
query23	14.81	1.38	0.60
query24	7.52	1.36	0.36
query25	0.45	0.15	0.06
query26	0.69	0.16	0.13
query27	0.06	0.05	0.04
query28	9.03	0.88	0.43
query29	12.57	4.09	3.38
query30	0.25	0.09	0.06
query31	2.82	0.58	0.38
query32	3.22	0.54	0.49
query33	3.11	3.05	3.08
query34	15.79	5.14	4.49
query35	4.49	4.48	4.49
query36	0.69	0.49	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.13
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.26 s
Total hot run time: 30.84 s

@eldenmoon
Copy link
Member Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26280	5075	5082	5075
q2	2068	290	163	163
q3	10401	1232	690	690
q4	10211	1013	530	530
q5	7559	2403	2324	2324
q6	188	177	133	133
q7	929	742	615	615
q8	9321	1304	1060	1060
q9	6959	5185	5156	5156
q10	6813	2329	1895	1895
q11	473	270	262	262
q12	341	354	217	217
q13	17754	3675	3058	3058
q14	246	228	219	219
q15	546	510	504	504
q16	611	601	584	584
q17	567	854	363	363
q18	7627	7288	7222	7222
q19	1223	953	580	580
q20	323	342	197	197
q21	4084	2590	2394	2394
q22	1001	1014	983	983
Total cold run time: 115525 ms
Total hot run time: 34224 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5431	5171	5176	5171
q2	241	317	229	229
q3	2186	2637	2328	2328
q4	1422	1804	1447	1447
q5	4532	4473	4409	4409
q6	213	168	126	126
q7	2032	1889	1763	1763
q8	2584	2456	2461	2456
q9	7172	7228	7132	7132
q10	3029	3223	2748	2748
q11	568	499	492	492
q12	669	773	631	631
q13	3510	3977	3292	3292
q14	296	289	269	269
q15	555	493	487	487
q16	629	661	649	649
q17	1158	1589	1354	1354
q18	7752	7614	7377	7377
q19	813	794	807	794
q20	1979	2025	1881	1881
q21	4997	4672	4566	4566
q22	1057	1011	965	965
Total cold run time: 52825 ms
Total hot run time: 50566 ms

@doris-robot
Copy link

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

query1	1011	481	469	469
query2	6548	1973	1976	1973
query3	6800	231	221	221
query4	26158	23160	22905	22905
query5	4363	674	491	491
query6	308	202	195	195
query7	4609	482	266	266
query8	326	250	253	250
query9	8647	2548	2538	2538
query10	489	316	251	251
query11	15311	15017	14751	14751
query12	156	115	110	110
query13	1657	511	401	401
query14	9304	5968	6067	5968
query15	208	187	161	161
query16	7293	640	471	471
query17	1175	729	561	561
query18	1981	422	300	300
query19	203	183	149	149
query20	119	117	127	117
query21	208	121	98	98
query22	4328	4301	4101	4101
query23	34085	33273	33014	33014
query24	8365	2370	2360	2360
query25	524	458	387	387
query26	1235	264	147	147
query27	2741	498	331	331
query28	4369	2420	2382	2382
query29	749	546	460	460
query30	288	216	188	188
query31	947	865	823	823
query32	72	64	64	64
query33	551	354	319	319
query34	768	838	484	484
query35	783	809	736	736
query36	944	990	872	872
query37	122	97	77	77
query38	4184	4044	4112	4044
query39	1444	1565	1436	1436
query40	208	143	105	105
query41	55	53	53	53
query42	119	103	102	102
query43	511	507	473	473
query44	1291	807	792	792
query45	178	176	168	168
query46	840	1024	635	635
query47	1771	1820	1756	1756
query48	378	415	303	303
query49	770	505	437	437
query50	692	735	401	401
query51	4152	4118	4151	4118
query52	114	109	101	101
query53	218	254	182	182
query54	489	492	412	412
query55	84	82	82	82
query56	285	275	258	258
query57	1149	1156	1083	1083
query58	240	256	233	233
query59	2659	2700	2670	2670
query60	301	288	268	268
query61	155	156	154	154
query62	794	751	683	683
query63	220	180	223	180
query64	4308	1002	672	672
query65	4362	4234	4255	4234
query66	1148	418	299	299
query67	16016	15489	15551	15489
query68	8099	866	514	514
query69	472	291	258	258
query70	1185	1145	1102	1102
query71	437	283	268	268
query72	5529	2342	5067	2342
query73	752	753	351	351
query74	9088	9133	8889	8889
query75	3474	3208	2697	2697
query76	3324	1196	746	746
query77	545	386	279	279
query78	9931	10836	9258	9258
query79	2234	819	565	565
query80	589	540	424	424
query81	496	255	225	225
query82	478	131	98	98
query83	189	184	156	156
query84	249	94	75	75
query85	799	419	333	333
query86	373	302	295	295
query87	4449	4659	4418	4418
query88	3604	2227	2265	2227
query89	382	311	276	276
query90	1950	208	208	208
query91	143	141	111	111
query92	81	59	57	57
query93	1375	1022	589	589
query94	701	418	301	301
query95	358	267	263	263
query96	488	578	278	278
query97	3159	3246	3080	3080
query98	223	211	235	211
query99	1320	1407	1281	1281
Total cold run time: 273356 ms
Total hot run time: 183389 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.12	0.10	0.11
query3	0.25	0.19	0.19
query4	1.60	0.18	0.19
query5	0.59	0.58	0.59
query6	1.19	0.72	0.72
query7	0.02	0.02	0.01
query8	0.04	0.03	0.04
query9	0.61	0.52	0.53
query10	0.58	0.57	0.57
query11	0.15	0.11	0.11
query12	0.15	0.11	0.12
query13	0.61	0.60	0.61
query14	2.77	2.81	2.70
query15	0.91	0.86	0.87
query16	0.38	0.38	0.38
query17	1.03	1.07	1.03
query18	0.22	0.20	0.20
query19	1.89	1.92	1.93
query20	0.01	0.01	0.02
query21	15.36	0.90	0.57
query22	0.74	1.17	0.72
query23	14.92	1.40	0.63
query24	7.02	2.08	0.38
query25	0.55	0.27	0.15
query26	0.73	0.16	0.14
query27	0.05	0.05	0.05
query28	8.89	0.86	0.45
query29	12.54	4.01	3.36
query30	0.24	0.10	0.06
query31	2.82	0.60	0.38
query32	3.22	0.56	0.47
query33	3.07	3.10	3.13
query34	15.88	5.09	4.51
query35	4.56	4.55	4.50
query36	0.66	0.49	0.49
query37	0.09	0.07	0.06
query38	0.04	0.04	0.04
query39	0.02	0.02	0.02
query40	0.16	0.12	0.14
query41	0.09	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 104.89 s
Total hot run time: 31.11 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 50.88% (13618/26763)
Line Coverage 40.27% (118234/293570)
Region Coverage 38.95% (60059/154209)
Branch Coverage 33.86% (30210/89224)

@eldenmoon eldenmoon requested a review from Copilot March 27, 2025 02:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the row store columns comparison logic during schema changes and ensures that partial column modifications are properly handled during ALTER TABLE operations.

  • Updated the logic in SchemaChangeHandler to better compare row store columns.
  • Modified the behavior in TableProperty to clear row store columns when an empty list is provided.

Reviewed Changes

Copilot reviewed 2 out of 6 changed files in this pull request and generated 1 comment.

File Description
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java Updates the condition and comparison logic for row store columns during schema change detection.
fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java Adjusts setRowStoreColumns to clear row store columns when an empty list is passed.
Files not reviewed (4)
  • be/src/service/point_query_executor.cpp: Language not supported
  • regression-test/data/point_query_p0/load.out: Language not supported
  • regression-test/suites/point_query_p0/load.groovy: Language not supported
  • regression-test/suites/point_query_p0/load_ck.groovy: Language not supported
Comments suppressed due to low confidence (1)

fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:1386

  • [nitpick] Using a null check on rsColumns may trigger schema change detection even when the list is empty. Consider reinstating an emptiness check if an empty list should be treated as no change.
if (storeRowColumn || rsColumns != null) {

buildRowStoreColumns();
} else {
// clear row store columns
this.rowStoreColumns = null;
Copy link

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

[nitpick] Clearing rowStoreColumns in setRowStoreColumns without updating the underlying properties map may lead to inconsistencies in later reads. Consider also clearing or updating the property key value for full consistency.

Suggested change
this.rowStoreColumns = null;
this.rowStoreColumns = null;
properties.remove(PropertyAnalyzer.PROPERTIES_ROW_STORE_COLUMNS);

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@Hastyshell Hastyshell 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
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@qidaye qidaye 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 Mar 27, 2025
@github-actions
Copy link
Contributor

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

@eldenmoon eldenmoon merged commit cf723a0 into apache:master Mar 27, 2025
26 of 30 checks passed
@eldenmoon eldenmoon deleted the fix-partial-rowstore branch March 27, 2025 07:40
@eldenmoon eldenmoon added the p0_b label Mar 28, 2025
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Mar 28, 2025
1. fix the row store columns comparison logic in SchemaChangeHandler.
The tests verify the correct behavior when comparing row store columns
during ALTER TABLE operations
2. fix partial columns when meet delete sign

These tests ensure that the system correctly determines when schema
changes are needed when users modify row store column properties through
ALTER TABLE statements.
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Mar 28, 2025
1. fix the row store columns comparison logic in SchemaChangeHandler.
The tests verify the correct behavior when comparing row store columns
during ALTER TABLE operations
2. fix partial columns when meet delete sign

These tests ensure that the system correctly determines when schema
changes are needed when users modify row store column properties through
ALTER TABLE statements.
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
1. fix the row store columns comparison logic in SchemaChangeHandler.
The tests verify the correct behavior when comparing row store columns
during ALTER TABLE operations
2. fix partial columns when meet delete sign

These tests ensure that the system correctly determines when schema
changes are needed when users modify row store column properties through
ALTER TABLE statements.
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.5-merged p0_b reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants