Skip to content

Conversation

@suxiaogang223
Copy link
Contributor

@suxiaogang223 suxiaogang223 commented Jan 15, 2026

What problem does this PR solve?

Overview

This PR improves Iceberg table branch/tag functionality by adding input parameter validation, optimizing snapshot loading logic, and significantly expanding test coverage.

Iceberg Logic Modifications

1. Optimize Snapshot Loading

File: fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java

  • Modified loadSnapshots method signature to accept specificTable parameter
  • Supports loading snapshot for a specific table instead of iterating through all tables
  • Caller (BindRelation.java:419) passes the concrete table object, improving performance and precision

2. Enhanced Parameter Validation

File: fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java

Added parameter validation for branch/tag creation operations:

  • RETAIN time value must be greater than 0
  • SNAPSHOTS (minimum snapshots to keep) must be greater than 0
  • RETENTION time must be greater than 0
  • Throws clear IllegalArgumentException with descriptive error messages

3. Branch/Tag Name Validation

File: fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java

  • Validate branch name is not empty when creating a branch
  • Validate tag name is not empty when creating a tag
  • Throws UserException to notify users

4. Syntax Support Limitation

File: regression-test/suites/external_table_p0/iceberg/iceberg_branch_tag_operate.groovy

Clarified that CREATE OR REPLACE BRANCH IF NOT EXISTS syntax combination is not supported

New Test Case Coverage

This PR adds 10 comprehensive test suites covering the following scenarios:

Test File Coverage
iceberg_branch_complex_queries.groovy Complex query scenarios with branch operations
iceberg_branch_cross_operations.groovy Cross operations between branches and tags
iceberg_branch_partition_operations.groovy Partition-related branch operations
iceberg_branch_retention_and_snapshot.groovy Snapshot expiration and retention policies
iceberg_branch_tag_auth.groovy Branch/tag permission and authorization
iceberg_branch_tag_edge_cases.groovy Edge cases and exception handling
iceberg_branch_tag_parallel_op.groovy Concurrent/parallel operations testing
iceberg_branch_tag_schema_change_extended.groovy Schema change scenarios
iceberg_branch_tag_system_tables.groovy System table query verification
iceberg_tag_retention_and_consistency.groovy Tag consistency validation

Improvements

  • More precise snapshot loading: Avoids unnecessary full table iteration
  • Stronger parameter validation: Catches configuration errors early with clear error messages
  • Comprehensive test coverage: Multi-dimensional validation from edge cases to concurrent operations

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

@Thearas
Copy link
Contributor

Thearas commented Jan 15, 2026

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?

@suxiaogang223 suxiaogang223 force-pushed the add_case_for_branch_tag branch from 2863f9b to d3d3328 Compare January 15, 2026 08:38
@suxiaogang223
Copy link
Contributor Author

run external

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/33) 🎉
Increment coverage report
Complete coverage report

@suxiaogang223 suxiaogang223 changed the title Add case for branch tag [Improvement](Iceberg) Enhance branch/tag operations with validation and comprehensive test coverage Jan 15, 2026
@suxiaogang223 suxiaogang223 changed the title [Improvement](Iceberg) Enhance branch/tag operations with validation and comprehensive test coverage [Enhance](Iceberg) Enhance branch/tag operations with validation and comprehensive test coverage Jan 15, 2026
@suxiaogang223
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17580	4164	4034	4034
q2	2095	358	231	231
q3	10151	1323	716	716
q4	10205	802	295	295
q5	7520	2019	2024	2019
q6	188	172	138	138
q7	941	786	652	652
q8	9267	1375	1151	1151
q9	4805	4647	4552	4552
q10	6700	1791	1406	1406
q11	522	281	291	281
q12	677	741	598	598
q13	17784	3796	3205	3205
q14	301	298	282	282
q15	573	525	510	510
q16	699	691	654	654
q17	659	777	503	503
q18	6823	6376	6998	6376
q19	1211	1062	638	638
q20	416	402	268	268
q21	3216	2686	2487	2487
q22	1192	1113	1043	1043
Total cold run time: 103525 ms
Total hot run time: 32039 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4319	4273	4301	4273
q2	311	425	324	324
q3	2288	2758	2383	2383
q4	1396	1965	1459	1459
q5	4479	4429	4345	4345
q6	212	172	123	123
q7	1988	1932	2022	1932
q8	2538	2460	2558	2460
q9	7135	7215	7210	7210
q10	2528	2758	2346	2346
q11	530	474	445	445
q12	759	770	688	688
q13	3659	4075	3205	3205
q14	260	280	252	252
q15	520	482	473	473
q16	600	667	588	588
q17	1120	1194	1251	1194
q18	7593	7329	7333	7329
q19	792	784	775	775
q20	1887	1945	1842	1842
q21	4528	4128	4125	4125
q22	1058	1086	975	975
Total cold run time: 50500 ms
Total hot run time: 48746 ms

@doris-robot
Copy link

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

query5	4859	611	468	468
query6	354	247	226	226
query7	4225	466	263	263
query8	353	252	248	248
query9	8768	2886	2882	2882
query10	548	392	334	334
query11	15399	15055	14853	14853
query12	181	117	118	117
query13	1255	469	385	385
query14	6499	3042	2790	2790
query14_1	2717	2678	2655	2655
query15	206	185	176	176
query16	987	498	510	498
query17	1090	670	578	578
query18	2642	448	361	361
query19	229	228	201	201
query20	124	116	115	115
query21	221	141	118	118
query22	3992	4218	3927	3927
query23	16219	15663	15459	15459
query23_1	15616	15542	15590	15542
query24	7180	1543	1169	1169
query24_1	1157	1189	1177	1177
query25	569	483	433	433
query26	1239	268	156	156
query27	2753	445	280	280
query28	4523	2141	2132	2132
query29	763	551	460	460
query30	308	244	214	214
query31	824	629	585	585
query32	86	78	73	73
query33	546	362	325	325
query34	904	899	536	536
query35	722	753	746	746
query36	937	890	857	857
query37	140	103	88	88
query38	2823	2700	2662	2662
query39	777	739	736	736
query39_1	728	722	705	705
query40	215	134	116	116
query41	66	62	62	62
query42	105	99	101	99
query43	453	481	421	421
query44	1324	752	734	734
query45	189	183	174	174
query46	819	943	594	594
query47	1340	1452	1393	1393
query48	309	322	237	237
query49	608	428	345	345
query50	615	272	220	220
query51	3836	3775	3797	3775
query52	108	115	93	93
query53	289	323	273	273
query54	297	265	260	260
query55	81	83	77	77
query56	313	301	314	301
query57	965	1006	944	944
query58	284	261	256	256
query59	2049	2065	1960	1960
query60	349	333	319	319
query61	162	155	156	155
query62	389	353	315	315
query63	296	267	276	267
query64	4822	1259	984	984
query65	3803	3765	3721	3721
query66	1409	408	320	320
query67	15671	15586	15456	15456
query68	2433	1078	753	753
query69	468	376	324	324
query70	1029	955	955	955
query71	319	317	282	282
query72	5346	3363	3340	3340
query73	612	727	313	313
query74	8767	8790	8511	8511
query75	2773	2842	2453	2453
query76	2275	1073	643	643
query77	347	386	300	300
query78	9774	10057	9207	9207
query79	1063	882	581	581
query80	1356	580	492	492
query81	543	258	232	232
query82	1134	148	110	110
query83	351	258	232	232
query84	259	115	98	98
query85	995	518	448	448
query86	413	294	293	293
query87	2901	2819	2753	2753
query88	3485	2591	2547	2547
query89	387	361	319	319
query90	1962	172	168	168
query91	172	168	146	146
query92	78	76	76	76
query93	918	907	529	529
query94	647	322	314	314
query95	596	343	376	343
query96	635	506	235	235
query97	2397	2390	2333	2333
query98	212	228	200	200
query99	582	595	514	514
Total cold run time: 249462 ms
Total hot run time: 174509 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.11	0.10
query5	0.27	0.25	0.25
query6	1.15	0.66	0.65
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.58	0.51	0.48
query10	0.56	0.54	0.56
query11	0.14	0.09	0.10
query12	0.14	0.10	0.11
query13	0.60	0.58	0.59
query14	0.93	0.94	0.93
query15	0.79	0.76	0.77
query16	0.39	0.42	0.39
query17	0.98	1.07	1.02
query18	0.23	0.22	0.21
query19	1.86	1.79	1.80
query20	0.01	0.01	0.02
query21	15.48	0.28	0.14
query22	4.95	0.05	0.05
query23	15.71	0.29	0.10
query24	2.03	0.27	0.53
query25	0.06	0.07	0.08
query26	0.14	0.14	0.13
query27	0.09	0.05	0.06
query28	4.02	1.07	0.90
query29	12.56	3.96	3.19
query30	0.29	0.14	0.11
query31	2.82	0.61	0.41
query32	3.24	0.57	0.46
query33	3.10	3.04	3.12
query34	15.71	5.15	4.43
query35	4.42	4.41	4.44
query36	0.66	0.50	0.49
query37	0.10	0.07	0.06
query38	0.07	0.04	0.04
query39	0.05	0.03	0.03
query40	0.17	0.14	0.14
query41	0.09	0.04	0.03
query42	0.05	0.03	0.03
query43	0.05	0.04	0.04
Total cold run time: 96.59 s
Total hot run time: 26.77 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 19.23% (5/26) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 84.62% (22/26) 🎉
Increment coverage report
Complete coverage report

@suxiaogang223
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17600	4254	4046	4046
q2	2046	355	258	258
q3	10117	1262	729	729
q4	10210	824	309	309
q5	7536	2067	1880	1880
q6	196	175	143	143
q7	918	795	655	655
q8	9279	1408	1166	1166
q9	4875	4639	4521	4521
q10	6777	1796	1409	1409
q11	508	310	291	291
q12	695	765	604	604
q13	17775	3852	3104	3104
q14	292	302	271	271
q15	597	512	499	499
q16	708	708	633	633
q17	666	787	532	532
q18	6596	6458	6360	6360
q19	1101	961	632	632
q20	400	351	248	248
q21	3077	2521	2298	2298
q22	1058	1026	947	947
Total cold run time: 103027 ms
Total hot run time: 31535 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4106	4020	4034	4020
q2	323	395	329	329
q3	2111	2597	2231	2231
q4	1338	1803	1336	1336
q5	4121	4054	3984	3984
q6	211	171	129	129
q7	1863	1756	1689	1689
q8	2794	2417	2427	2417
q9	7257	7133	7170	7133
q10	2570	2827	2311	2311
q11	555	484	451	451
q12	756	739	597	597
q13	3643	4128	3517	3517
q14	279	309	303	303
q15	544	508	486	486
q16	654	715	651	651
q17	1211	1354	1417	1354
q18	8237	7728	8201	7728
q19	918	893	873	873
q20	1945	2070	1925	1925
q21	4720	4239	4083	4083
q22	1067	1020	1005	1005
Total cold run time: 51223 ms
Total hot run time: 48552 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174087 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 036a18df42886968d99c6eec4d6068293f906252, data reload: false

query5	4362	607	500	500
query6	352	230	230	230
query7	4229	459	258	258
query8	346	253	240	240
query9	8742	2842	2874	2842
query10	508	384	324	324
query11	15382	15014	14845	14845
query12	176	115	114	114
query13	1261	492	384	384
query14	6455	3053	2839	2839
query14_1	2806	2730	2786	2730
query15	205	191	174	174
query16	991	490	484	484
query17	1113	674	586	586
query18	2544	465	344	344
query19	231	218	205	205
query20	123	114	116	114
query21	217	138	113	113
query22	4067	3966	4041	3966
query23	15972	15660	15438	15438
query23_1	15366	15434	15554	15434
query24	7113	1534	1177	1177
query24_1	1173	1146	1170	1146
query25	557	468	427	427
query26	1253	271	156	156
query27	2750	460	283	283
query28	4532	2121	2119	2119
query29	798	547	463	463
query30	315	230	205	205
query31	802	629	568	568
query32	86	73	75	73
query33	544	368	316	316
query34	895	883	531	531
query35	733	752	672	672
query36	889	965	837	837
query37	136	98	87	87
query38	2746	2655	2731	2655
query39	768	735	726	726
query39_1	748	711	686	686
query40	217	141	116	116
query41	65	60	61	60
query42	102	101	100	100
query43	467	468	423	423
query44	1342	735	732	732
query45	184	182	179	179
query46	829	951	565	565
query47	1433	1402	1364	1364
query48	319	322	238	238
query49	628	413	327	327
query50	614	269	205	205
query51	3760	3880	3884	3880
query52	101	106	95	95
query53	290	328	275	275
query54	287	269	258	258
query55	84	80	75	75
query56	311	301	317	301
query57	1017	961	894	894
query58	263	255	249	249
query59	2011	2119	2022	2022
query60	332	340	313	313
query61	158	157	154	154
query62	400	366	316	316
query63	295	272	258	258
query64	4882	1293	990	990
query65	3813	3704	3717	3704
query66	1427	412	323	323
query67	15381	15569	15447	15447
query68	2420	1110	746	746
query69	430	353	327	327
query70	999	958	946	946
query71	327	304	281	281
query72	5450	3245	3285	3245
query73	606	727	309	309
query74	8790	8746	8552	8552
query75	2775	2771	2484	2484
query76	2297	1047	660	660
query77	359	409	296	296
query78	9776	9787	9127	9127
query79	2371	898	576	576
query80	1724	602	488	488
query81	537	261	236	236
query82	943	148	110	110
query83	320	255	237	237
query84	251	115	89	89
query85	912	510	455	455
query86	403	294	282	282
query87	2905	2878	2770	2770
query88	3511	2589	2556	2556
query89	393	355	328	328
query90	1971	182	160	160
query91	171	158	138	138
query92	76	77	64	64
query93	1149	909	529	529
query94	659	326	306	306
query95	602	335	374	335
query96	639	513	228	228
query97	2323	2374	2303	2303
query98	230	197	200	197
query99	619	577	525	525
Total cold run time: 249147 ms
Total hot run time: 174087 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.10	0.04	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.11
query5	0.28	0.24	0.25
query6	1.14	0.66	0.65
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.57	0.49	0.50
query10	0.55	0.54	0.54
query11	0.14	0.10	0.09
query12	0.14	0.10	0.11
query13	0.60	0.58	0.59
query14	0.96	0.95	0.94
query15	0.79	0.77	0.79
query16	0.39	0.41	0.40
query17	1.06	1.02	1.02
query18	0.22	0.20	0.21
query19	1.89	1.85	1.78
query20	0.02	0.01	0.02
query21	15.43	0.26	0.14
query22	5.15	0.06	0.04
query23	15.81	0.29	0.10
query24	2.02	0.56	0.35
query25	0.11	0.14	0.13
query26	0.14	0.14	0.14
query27	0.08	0.06	0.06
query28	5.12	1.06	0.89
query29	12.52	4.04	3.20
query30	0.28	0.14	0.12
query31	2.81	0.65	0.40
query32	3.24	0.56	0.46
query33	3.04	3.07	3.06
query34	15.98	5.15	4.41
query35	4.49	4.51	4.42
query36	0.65	0.49	0.49
query37	0.10	0.06	0.06
query38	0.08	0.04	0.04
query39	0.05	0.03	0.04
query40	0.16	0.14	0.13
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 98.28 s
Total hot run time: 26.93 s

@suxiaogang223
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17703	4213	4051	4051
q2	2216	343	236	236
q3	10178	1257	702	702
q4	10231	813	307	307
q5	7505	2093	1824	1824
q6	192	165	138	138
q7	934	792	651	651
q8	9257	1417	1147	1147
q9	4923	4646	4578	4578
q10	7049	1775	1392	1392
q11	538	298	282	282
q12	733	763	597	597
q13	17815	3812	3139	3139
q14	305	289	279	279
q15	596	516	514	514
q16	692	694	635	635
q17	673	808	503	503
q18	6740	6407	7059	6407
q19	1311	1020	640	640
q20	434	397	268	268
q21	3319	2678	2559	2559
q22	1171	1098	1085	1085
Total cold run time: 104515 ms
Total hot run time: 31934 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4459	4425	4262	4262
q2	344	448	335	335
q3	2316	2981	2442	2442
q4	1423	1970	1612	1612
q5	4573	4536	4535	4535
q6	226	176	127	127
q7	2028	2049	1946	1946
q8	2572	2552	2474	2474
q9	7441	7113	7224	7113
q10	2395	2617	2164	2164
q11	529	464	443	443
q12	675	736	606	606
q13	3492	3963	3087	3087
q14	264	272	257	257
q15	526	484	488	484
q16	637	673	611	611
q17	1139	1308	1347	1308
q18	7524	7129	7064	7064
q19	879	861	839	839
q20	1933	1941	1812	1812
q21	4527	4272	4165	4165
q22	1079	1038	1026	1026
Total cold run time: 50981 ms
Total hot run time: 48712 ms

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/26) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

TPC-DS: Total hot run time: 176797 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 76b825d8258d3bd3da0fd735f7bb28f07f1a4462, data reload: false

query5	4419	642	498	498
query6	379	252	234	234
query7	4239	486	285	285
query8	386	275	279	275
query9	8701	3079	3102	3079
query10	519	415	332	332
query11	15342	15231	14966	14966
query12	190	115	117	115
query13	1259	492	389	389
query14	6484	3067	2878	2878
query14_1	2696	2693	2653	2653
query15	205	198	179	179
query16	1047	482	476	476
query17	1122	684	565	565
query18	2684	437	339	339
query19	225	223	204	204
query20	125	118	115	115
query21	246	139	121	121
query22	3985	4060	4107	4060
query23	16137	15739	15487	15487
query23_1	15461	15562	15523	15523
query24	7094	1596	1237	1237
query24_1	1224	1252	1237	1237
query25	577	462	419	419
query26	1242	271	158	158
query27	2759	457	289	289
query28	4493	2323	2307	2307
query29	816	532	440	440
query30	365	263	209	209
query31	853	643	598	598
query32	84	80	86	80
query33	543	377	325	325
query34	928	909	553	553
query35	748	778	715	715
query36	943	976	898	898
query37	190	106	94	94
query38	2733	2687	2689	2687
query39	790	768	726	726
query39_1	714	713	730	713
query40	272	145	122	122
query41	72	69	65	65
query42	106	105	100	100
query43	509	511	482	482
query44	1406	753	779	753
query45	188	190	176	176
query46	852	958	608	608
query47	1493	1547	1463	1463
query48	340	341	282	282
query49	626	464	361	361
query50	714	297	212	212
query51	4009	3908	3853	3853
query52	101	106	96	96
query53	303	340	274	274
query54	296	279	265	265
query55	94	88	87	87
query56	324	321	320	320
query57	1021	1013	967	967
query58	282	275	266	266
query59	2081	2458	2269	2269
query60	354	336	332	332
query61	157	156	190	156
query62	394	381	307	307
query63	302	260	270	260
query64	4954	1285	980	980
query65	3832	3808	3748	3748
query66	1392	432	316	316
query67	15630	15684	15462	15462
query68	2416	1141	812	812
query69	450	371	330	330
query70	1048	1022	1031	1022
query71	337	321	307	307
query72	5341	3089	3286	3089
query73	639	731	331	331
query74	8777	8823	8542	8542
query75	2761	2783	2440	2440
query76	2299	1076	701	701
query77	367	382	314	314
query78	9736	9844	9114	9114
query79	2868	952	599	599
query80	1757	585	495	495
query81	572	266	237	237
query82	966	148	117	117
query83	342	271	266	266
query84	264	122	95	95
query85	954	497	459	459
query86	475	343	313	313
query87	2884	2891	2811	2811
query88	3732	2786	2803	2786
query89	402	365	347	347
query90	1963	181	170	170
query91	170	169	136	136
query92	82	76	72	72
query93	1385	949	569	569
query94	648	320	283	283
query95	577	404	323	323
query96	661	513	232	232
query97	2369	2371	2338	2338
query98	248	208	206	206
query99	608	590	527	527
Total cold run time: 252558 ms
Total hot run time: 176797 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.10	0.05	0.05
query3	0.26	0.09	0.08
query4	1.61	0.12	0.11
query5	0.28	0.26	0.24
query6	1.15	0.66	0.65
query7	0.03	0.03	0.02
query8	0.05	0.04	0.04
query9	0.55	0.51	0.50
query10	0.55	0.55	0.55
query11	0.15	0.09	0.10
query12	0.15	0.11	0.11
query13	0.61	0.59	0.60
query14	0.96	0.93	0.96
query15	0.79	0.77	0.78
query16	0.39	0.40	0.40
query17	1.05	1.02	1.04
query18	0.24	0.21	0.22
query19	1.93	1.82	1.79
query20	0.02	0.01	0.02
query21	15.45	0.29	0.14
query22	5.39	0.06	0.05
query23	16.12	0.29	0.10
query24	1.02	0.30	0.57
query25	0.09	0.09	0.05
query26	0.16	0.14	0.14
query27	0.08	0.06	0.06
query28	3.84	1.09	0.89
query29	12.59	3.97	3.22
query30	0.28	0.15	0.12
query31	2.83	0.64	0.40
query32	3.25	0.56	0.47
query33	2.99	2.96	3.12
query34	16.08	5.09	4.45
query35	4.45	4.46	4.43
query36	0.65	0.51	0.49
query37	0.10	0.06	0.07
query38	0.07	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.74 s
Total hot run time: 26.82 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 16, 2026
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/26) 🎉
Increment coverage report
Complete coverage report

@morningman morningman merged commit 202c75d into apache:master Jan 16, 2026
33 of 34 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 16, 2026
…comprehensive test coverage (#59917)

- Related Pr: #51727
### What problem does this PR solve?

## Overview
This PR improves Iceberg table branch/tag functionality by adding input
parameter validation, optimizing snapshot loading logic, and
significantly expanding test coverage.

## Iceberg Logic Modifications

### 1. Optimize Snapshot Loading
**File**:
`fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java`

- Modified `loadSnapshots` method signature to accept `specificTable`
parameter
- Supports loading snapshot for a specific table instead of iterating
through all tables
- Caller (`BindRelation.java:419`) passes the concrete table object,
improving performance and precision

### 2. Enhanced Parameter Validation
**File**:
`fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java`

Added parameter validation for branch/tag creation operations:
- `RETAIN` time value must be greater than 0
- `SNAPSHOTS` (minimum snapshots to keep) must be greater than 0
- `RETENTION` time must be greater than 0
- Throws clear `IllegalArgumentException` with descriptive error
messages

### 3. Branch/Tag Name Validation
**File**:
`fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java`

- Validate branch name is not empty when creating a branch
- Validate tag name is not empty when creating a tag
- Throws `UserException` to notify users

### 4. Syntax Support Limitation
**File**:
`regression-test/suites/external_table_p0/iceberg/iceberg_branch_tag_operate.groovy`

Clarified that `CREATE OR REPLACE BRANCH IF NOT EXISTS` syntax
combination is not supported

## New Test Case Coverage

This PR adds 10 comprehensive test suites covering the following
scenarios:

| Test File | Coverage |
|-----------|----------|
| `iceberg_branch_complex_queries.groovy` | Complex query scenarios with
branch operations |
| `iceberg_branch_cross_operations.groovy` | Cross operations between
branches and tags |
| `iceberg_branch_partition_operations.groovy` | Partition-related
branch operations |
| `iceberg_branch_retention_and_snapshot.groovy` | Snapshot expiration
and retention policies |
| `iceberg_branch_tag_auth.groovy` | Branch/tag permission and
authorization |
| `iceberg_branch_tag_edge_cases.groovy` | Edge cases and exception
handling |
| `iceberg_branch_tag_parallel_op.groovy` | Concurrent/parallel
operations testing |
| `iceberg_branch_tag_schema_change_extended.groovy` | Schema change
scenarios |
| `iceberg_branch_tag_system_tables.groovy` | System table query
verification |
| `iceberg_tag_retention_and_consistency.groovy` | Tag consistency
validation |

## Improvements

- **More precise snapshot loading**: Avoids unnecessary full table
iteration
- **Stronger parameter validation**: Catches configuration errors early
with clear error messages
- **Comprehensive test coverage**: Multi-dimensional validation from
edge cases to concurrent operations

Co-authored-by: zgxme <u143@qq.com>
@suxiaogang223 suxiaogang223 deleted the add_case_for_branch_tag branch January 17, 2026 15:56
yiguolei pushed a commit that referenced this pull request Jan 21, 2026
…idation and comprehensive test coverage #59917 (#60023)

- Cherry-picked from #59917
- Iceberg Docker updated from #59272

---------

Co-authored-by: zgxme <u143@qq.com>
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.1.x dev/4.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants