Skip to content

[fix] remove useless const_cast and explain const_cast(1) - #55943

Merged
yiguolei merged 18 commits into
apache:masterfrom
wumeibanfa:remove_const_1
Nov 18, 2025
Merged

yiguolei merged 18 commits into
apache:masterfrom
wumeibanfa:remove_const_1

Conversation

@wumeibanfa

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

go through whole be/ and find all const_cast

Issue Number: #55057

Problem Summary:

  1. remove useless const_cast
  2. explain why using const_cast does not result in undefined behavior
  3. don't modify some const_cast
    (1) some code in DBUG_EXECUTE_IF or test file
    (2) underlying data structures, such as cow
    (3) const_cast<const T*>

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

@Thearas

Thearas commented Sep 12, 2025

Copy link
Copy Markdown
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?

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17613	5273	5074	5074
q2	2018	321	249	249
q3	10214	1305	740	740
q4	10225	1031	523	523
q5	7563	2442	2390	2390
q6	186	167	136	136
q7	928	759	640	640
q8	9342	1345	1164	1164
q9	7218	5083	5105	5083
q10	6997	2392	1962	1962
q11	526	322	280	280
q12	377	358	231	231
q13	17776	3662	3016	3016
q14	251	244	216	216
q15	585	487	490	487
q16	1002	999	932	932
q17	615	863	381	381
q18	8003	7196	7063	7063
q19	1534	989	555	555
q20	331	335	245	245
q21	3745	3217	2370	2370
q22	1063	1041	1003	1003
Total cold run time: 108112 ms
Total hot run time: 34740 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5241	5127	5105	5105
q2	245	329	230	230
q3	2229	2655	2325	2325
q4	1381	1798	1337	1337
q5	4375	4646	4608	4608
q6	220	171	129	129
q7	2057	1985	1838	1838
q8	2649	2747	2643	2643
q9	7523	7380	7449	7380
q10	3086	3298	2873	2873
q11	571	522	498	498
q12	740	805	622	622
q13	3685	3843	3315	3315
q14	295	329	268	268
q15	519	491	509	491
q16	1067	1119	1040	1040
q17	1186	1603	1385	1385
q18	7890	7672	7660	7660
q19	814	803	884	803
q20	2013	2056	1914	1914
q21	5110	4411	4385	4385
q22	1092	1049	1003	1003
Total cold run time: 53988 ms
Total hot run time: 51852 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 188584 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 23b34702ca290867816be3276caf9333b1773c14, data reload: false

query1	1037	466	409	409
query2	6557	1712	1669	1669
query3	6759	225	232	225
query4	26388	23617	22872	22872
query5	4386	661	543	543
query6	341	250	243	243
query7	4647	515	304	304
query8	306	271	252	252
query9	8694	2912	2904	2904
query10	483	361	290	290
query11	15818	15030	15070	15030
query12	182	122	118	118
query13	1676	527	425	425
query14	10986	8980	9200	8980
query15	205	228	170	170
query16	7440	673	479	479
query17	1206	739	608	608
query18	2064	426	355	355
query19	205	219	167	167
query20	148	131	120	120
query21	216	130	116	116
query22	4194	4280	4018	4018
query23	33988	33052	32959	32959
query24	8267	2348	2389	2348
query25	584	540	446	446
query26	1240	279	169	169
query27	2733	546	396	396
query28	4439	2288	2230	2230
query29	782	616	552	552
query30	292	221	198	198
query31	912	799	730	730
query32	89	82	82	82
query33	611	399	349	349
query34	793	846	515	515
query35	867	822	752	752
query36	995	1009	938	938
query37	128	117	99	99
query38	3546	3519	3532	3519
query39	1497	1619	1417	1417
query40	221	138	125	125
query41	63	60	61	60
query42	129	115	119	115
query43	519	514	478	478
query44	1355	860	862	860
query45	184	185	172	172
query46	854	1024	659	659
query47	1791	1801	1772	1772
query48	401	428	322	322
query49	758	510	409	409
query50	652	685	398	398
query51	3890	3912	4002	3912
query52	123	121	114	114
query53	250	270	206	206
query54	629	620	572	572
query55	100	98	96	96
query56	375	356	338	338
query57	1236	1211	1173	1173
query58	336	282	272	272
query59	2564	2695	2541	2541
query60	356	359	346	346
query61	164	162	162	162
query62	809	710	676	676
query63	224	195	190	190
query64	4444	1155	835	835
query65	4022	3985	3967	3967
query66	1140	455	359	359
query67	15520	15307	15122	15122
query68	7865	930	581	581
query69	483	385	297	297
query70	1369	1258	1288	1258
query71	598	345	328	328
query72	5801	5017	5220	5017
query73	654	586	359	359
query74	9172	9119	8675	8675
query75	3724	3219	2785	2785
query76	3429	1157	748	748
query77	814	432	329	329
query78	9585	9743	8829	8829
query79	2406	853	597	597
query80	693	595	527	527
query81	516	256	234	234
query82	210	159	137	137
query83	263	269	260	260
query84	273	114	94	94
query85	851	453	424	424
query86	384	330	316	316
query87	3698	3727	3636	3636
query88	3747	2218	2203	2203
query89	391	335	293	293
query90	1945	218	224	218
query91	167	166	139	139
query92	93	79	71	71
query93	1912	972	658	658
query94	673	412	328	328
query95	409	341	326	326
query96	486	581	275	275
query97	2883	2978	2888	2888
query98	253	220	219	219
query99	1372	1413	1288	1288
Total cold run time: 275929 ms
Total hot run time: 188584 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.25	0.09	0.09
query4	1.61	0.12	0.11
query5	0.29	0.27	0.26
query6	1.17	0.65	0.65
query7	0.04	0.03	0.03
query8	0.06	0.05	0.05
query9	0.61	0.52	0.53
query10	0.59	0.58	0.58
query11	0.17	0.11	0.11
query12	0.16	0.12	0.15
query13	0.63	0.62	0.61
query14	1.03	1.04	1.02
query15	0.88	0.86	0.88
query16	0.39	0.40	0.39
query17	1.02	1.07	1.06
query18	0.22	0.20	0.20
query19	1.96	1.83	1.82
query20	0.01	0.02	0.02
query21	15.40	0.95	0.58
query22	0.77	1.23	0.66
query23	14.91	1.38	0.64
query24	7.36	1.80	0.36
query25	0.33	0.25	0.07
query26	0.56	0.15	0.13
query27	0.06	0.06	0.05
query28	9.72	0.90	0.42
query29	12.62	3.85	3.30
query30	0.30	0.13	0.11
query31	2.85	0.59	0.38
query32	3.26	0.55	0.47
query33	3.11	3.03	3.13
query34	16.09	5.48	4.86
query35	4.92	4.89	4.90
query36	0.69	0.51	0.49
query37	0.11	0.08	0.07
query38	0.06	0.05	0.04
query39	0.04	0.03	0.02
query40	0.18	0.16	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.06	0.03	0.03
Total cold run time: 104.77 s
Total hot run time: 29.4 s

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 39.47% (120/304) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.21% (17423/33371)
Line Coverage 37.43% (158345/423071)
Region Coverage 31.99% (120723/377397)
Branch Coverage 33.38% (52993/158765)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 80.52% (248/308) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 70.82% (23107/32630)
Line Coverage 57.20% (241408/422057)
Region Coverage 52.57% (201020/382388)
Branch Coverage 54.18% (86399/159466)

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run nonConcurrent

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run p0

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 80.52% (248/308) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 70.82% (23107/32630)
Line Coverage 57.20% (241428/422057)
Region Coverage 52.55% (200952/382388)
Branch Coverage 54.19% (86412/159466)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 80.52% (248/308) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 70.80% (23101/32630)
Line Coverage 57.17% (241281/422057)
Region Coverage 52.49% (200720/382388)
Branch Coverage 54.14% (86341/159466)

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

query1	0.06	0.04	0.05
query2	0.09	0.06	0.06
query3	0.25	0.08	0.09
query4	1.61	0.11	0.12
query5	0.28	0.31	0.25
query6	1.17	0.65	0.66
query7	0.04	0.03	0.03
query8	0.05	0.04	0.05
query9	0.63	0.54	0.53
query10	0.57	0.59	0.58
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.62	0.62	0.63
query14	1.03	1.04	1.00
query15	0.88	0.86	0.86
query16	0.42	0.41	0.40
query17	1.05	1.03	1.05
query18	0.22	0.20	0.21
query19	1.93	1.82	1.80
query20	0.02	0.01	0.01
query21	15.43	0.90	0.57
query22	0.77	1.23	0.77
query23	14.82	1.41	0.64
query24	6.88	1.32	0.65
query25	0.48	0.19	0.15
query26	0.65	0.16	0.14
query27	0.08	0.06	0.06
query28	9.79	1.35	0.94
query29	12.58	3.88	3.21
query30	0.28	0.14	0.11
query31	2.83	0.59	0.40
query32	3.25	0.56	0.49
query33	3.20	3.06	3.06
query34	16.17	5.47	4.84
query35	4.91	4.93	4.91
query36	0.68	0.50	0.53
query37	0.11	0.08	0.08
query38	0.07	0.05	0.04
query39	0.03	0.03	0.03
query40	0.17	0.14	0.15
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: 104.58 s
Total hot run time: 30.34 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 58.82% (80/136) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.40% (17609/33603)
Line Coverage 37.62% (159960/425215)
Region Coverage 32.16% (121988/379324)
Branch Coverage 33.51% (53501/159656)

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

query1	0.07	0.06	0.06
query2	0.10	0.06	0.06
query3	0.26	0.09	0.10
query4	1.61	0.12	0.12
query5	0.31	0.28	0.27
query6	1.22	0.70	0.68
query7	0.04	0.04	0.03
query8	0.07	0.06	0.05
query9	0.67	0.58	0.57
query10	0.63	0.62	0.62
query11	0.20	0.13	0.13
query12	0.19	0.15	0.14
query13	0.67	0.63	0.63
query14	1.06	1.05	1.07
query15	0.95	0.91	0.96
query16	0.43	0.45	0.47
query17	1.11	1.26	1.16
query18	0.24	0.22	0.23
query19	2.02	2.02	2.00
query20	0.02	0.01	0.01
query21	15.39	0.19	0.16
query22	5.15	0.08	0.05
query23	15.63	0.30	0.11
query24	2.52	1.32	0.69
query25	0.09	0.08	0.07
query26	0.16	0.16	0.16
query27	0.09	0.07	0.06
query28	5.09	1.22	0.98
query29	12.67	4.69	3.76
query30	0.30	0.14	0.12
query31	2.84	0.67	0.41
query32	3.26	0.58	0.48
query33	3.20	3.13	3.25
query34	16.26	5.55	4.93
query35	4.97	5.06	4.97
query36	0.75	0.56	0.53
query37	0.12	0.08	0.08
query38	0.07	0.05	0.04
query39	0.04	0.03	0.03
query40	0.19	0.15	0.15
query41	0.09	0.03	0.03
query42	0.05	0.04	0.03
query43	0.05	0.04	0.04
Total cold run time: 100.85 s
Total hot run time: 30.26 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 46.51% (20/43) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.60% (17897/34025)
Line Coverage 37.84% (162345/429016)
Region Coverage 32.23% (123687/383763)
Branch Coverage 33.66% (54227/161125)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 51.16% (22/43) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.45% (23834/33358)
Line Coverage 57.83% (247959/428768)
Region Coverage 52.83% (205358/388721)
Branch Coverage 54.61% (88481/162020)

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run p0

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 51.16% (22/43) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.45% (23834/33358)
Line Coverage 57.83% (247947/428768)
Region Coverage 52.83% (205346/388721)
Branch Coverage 54.61% (88472/162020)

@wumeibanfa

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17616	5137	5016	5016
q2	2002	380	244	244
q3	10150	1287	728	728
q4	10241	923	357	357
q5	7528	2315	2443	2315
q6	194	176	140	140
q7	916	781	638	638
q8	9355	1398	1121	1121
q9	7081	5212	5187	5187
q10	6900	2220	1797	1797
q11	497	294	269	269
q12	368	386	225	225
q13	17778	3679	3101	3101
q14	241	240	218	218
q15	576	522	497	497
q16	1012	986	932	932
q17	588	865	365	365
q18	7592	7231	7186	7186
q19	1092	984	562	562
q20	353	344	225	225
q21	3726	2574	2294	2294
q22	1081	1042	992	992
Total cold run time: 106887 ms
Total hot run time: 34409 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5129	5123	5066	5066
q2	254	346	231	231
q3	2155	2682	2317	2317
q4	1371	1753	1353	1353
q5	4192	4387	4658	4387
q6	225	209	137	137
q7	2110	1997	1867	1867
q8	2686	2609	2616	2609
q9	7279	7265	7287	7265
q10	3022	3259	2821	2821
q11	595	531	495	495
q12	696	946	626	626
q13	3399	3806	3422	3422
q14	286	323	271	271
q15	538	506	513	506
q16	1121	1123	1061	1061
q17	1257	1660	1396	1396
q18	7999	7746	7612	7612
q19	812	814	877	814
q20	1999	2085	1910	1910
q21	5056	4593	4267	4267
q22	1094	1066	1012	1012
Total cold run time: 53275 ms
Total hot run time: 51445 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 188778 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 7b228289432918368bb5ae6cf52f2ea954a0e8dc, data reload: false

query1	1043	400	392	392
query2	6582	1749	1718	1718
query3	6770	225	236	225
query4	26168	23884	23488	23488
query5	4378	627	485	485
query6	324	230	223	223
query7	4650	497	297	297
query8	314	249	265	249
query9	8727	2575	2597	2575
query10	494	326	292	292
query11	15313	15054	14898	14898
query12	179	117	110	110
query13	1678	560	428	428
query14	10290	9272	9173	9173
query15	200	195	172	172
query16	7148	655	531	531
query17	980	754	659	659
query18	1985	418	331	331
query19	217	198	180	180
query20	126	126	121	121
query21	213	133	111	111
query22	4139	4157	4181	4157
query23	33860	33172	33269	33172
query24	8426	2424	2424	2424
query25	627	502	448	448
query26	1250	275	163	163
query27	2764	490	360	360
query28	4470	2218	2192	2192
query29	845	624	484	484
query30	300	220	196	196
query31	879	804	766	766
query32	84	80	70	70
query33	603	382	323	323
query34	814	834	528	528
query35	840	844	744	744
query36	941	970	898	898
query37	127	108	89	89
query38	3516	3490	3491	3490
query39	1480	1425	1406	1406
query40	230	131	121	121
query41	69	65	64	64
query42	130	115	113	113
query43	490	499	457	457
query44	1246	754	746	746
query45	186	173	173	173
query46	872	1004	639	639
query47	1768	1796	1734	1734
query48	396	444	328	328
query49	798	514	407	407
query50	658	682	412	412
query51	3982	3959	4014	3959
query52	116	110	105	105
query53	238	278	204	204
query54	322	317	299	299
query55	89	93	86	86
query56	344	316	362	316
query57	1176	1192	1141	1141
query58	299	285	279	279
query59	2681	2786	2620	2620
query60	357	356	349	349
query61	196	191	209	191
query62	787	732	681	681
query63	240	197	198	197
query64	4692	1288	988	988
query65	4009	3937	3974	3937
query66	1200	451	357	357
query67	15518	15124	15060	15060
query68	8306	925	606	606
query69	503	333	296	296
query70	1322	1265	1249	1249
query71	461	346	334	334
query72	6229	4905	4854	4854
query73	640	571	357	357
query74	8824	9090	8603	8603
query75	3770	3281	2831	2831
query76	3473	1141	730	730
query77	808	409	321	321
query78	9450	9583	8831	8831
query79	2515	834	605	605
query80	738	566	503	503
query81	525	272	232	232
query82	445	162	135	135
query83	295	263	240	240
query84	299	113	90	90
query85	944	487	440	440
query86	387	305	302	302
query87	3680	3702	3750	3702
query88	3611	2295	2279	2279
query89	383	339	297	297
query90	1891	218	214	214
query91	171	166	141	141
query92	88	70	62	62
query93	2168	971	641	641
query94	719	450	345	345
query95	402	325	315	315
query96	487	566	293	293
query97	2974	2973	2904	2904
query98	254	208	208	208
query99	1451	1386	1287	1287
Total cold run time: 275046 ms
Total hot run time: 188778 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.10	0.05	0.05
query3	0.25	0.08	0.09
query4	1.61	0.12	0.11
query5	0.27	0.24	0.24
query6	1.16	0.64	0.64
query7	0.03	0.03	0.02
query8	0.06	0.05	0.04
query9	0.59	0.52	0.52
query10	0.58	0.57	0.57
query11	0.15	0.11	0.12
query12	0.16	0.13	0.12
query13	0.62	0.61	0.61
query14	1.00	1.00	1.00
query15	0.85	0.85	0.83
query16	0.40	0.40	0.41
query17	1.01	1.00	1.04
query18	0.22	0.20	0.20
query19	1.93	1.77	1.82
query20	0.02	0.01	0.01
query21	15.45	0.19	0.13
query22	5.15	0.07	0.04
query23	15.66	0.26	0.11
query24	2.96	0.60	1.44
query25	0.08	0.06	0.05
query26	0.16	0.15	0.13
query27	0.07	0.05	0.05
query28	4.59	1.15	0.94
query29	12.65	3.87	3.22
query30	0.29	0.14	0.12
query31	2.81	0.58	0.39
query32	3.24	0.55	0.48
query33	3.13	3.08	3.15
query34	15.70	5.11	4.52
query35	4.55	4.52	4.58
query36	0.70	0.50	0.49
query37	0.10	0.07	0.06
query38	0.06	0.04	0.03
query39	0.04	0.04	0.04
query40	0.17	0.15	0.13
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 98.8 s
Total hot run time: 27.59 s

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Nov 14, 2025
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 44.19% (19/43) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.82% (18285/34620)
Line Coverage 38.18% (166264/435435)
Region Coverage 33.18% (129246/389585)
Branch Coverage 33.91% (55463/163578)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 51.16% (22/43) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.53% (24336/34020)
Line Coverage 58.03% (253059/436101)
Region Coverage 53.50% (211382/395083)
Branch Coverage 54.76% (90154/164641)

@yiguolei
yiguolei merged commit 48fcb2a into apache:master Nov 18, 2025
13 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2025
### What problem does this PR solve?
 go through whole be/ and find all const_cast

Issue Number: #55057 

Problem Summary:
1. remove useless const_cast
2. explain why using const_cast does not result in undefined behavior
3. don't modify some const_cast
    (1) some code in DBUG_EXECUTE_IF or test file
    (2) underlying data structures, such as cow
    (3) const_cast<const T*>


### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [x] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
yiguolei pushed a commit that referenced this pull request Nov 19, 2025
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
### What problem does this PR solve?
 go through whole be/ and find all const_cast

Issue Number: apache#55057 

Problem Summary:
1. remove useless const_cast
2. explain why using const_cast does not result in undefined behavior
3. don't modify some const_cast
    (1) some code in DBUG_EXECUTE_IF or test file
    (2) underlying data structures, such as cow
    (3) const_cast<const T*>


### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [x] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
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/4.0.2-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants