Skip to content

[refine](column) strong type array and map offsets#63678

Merged
Mryange merged 1 commit into
apache:masterfrom
Mryange:refine-array-map-strong-type-offset
Jun 1, 2026
Merged

[refine](column) strong type array and map offsets#63678
Mryange merged 1 commit into
apache:masterfrom
Mryange:refine-array-map-strong-type-offset

Conversation

@Mryange

@Mryange Mryange commented May 26, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Array and map offset subcolumns were still stored and exposed through generic IColumn pointers, so callers had to repeatedly downcast them back to their concrete offset column types. Root cause: the ownership, COW mutation, deserialization, and segment reader write-back paths still treated these offsets as generic subcolumns, which left the strong-typing change incomplete and kept redundant same-type assert_cast usage in affected callers and tests. This change promotes ColumnArray offsets and ColumnMap offsets_column to typed wrapped pointers, updates the typed accessors and generic write-back paths to preserve the concrete offset column type, and removes the now-redundant casts in array functions, lambda functions, and unit tests. It also cleans up one redundant nullable null-map cast uncovered during the BE UT compile.

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
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?

@Mryange

Mryange commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@Mryange

Mryange commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

OpenCode automated review failed and did not complete.

Error: Review step was skipped (possibly timeout or cancelled)
Workflow run: https://github.com/apache/doris/actions/runs/26445539067

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17658	4163	4188	4163
q2	q3	10770	1434	834	834
q4	4682	480	342	342
q5	7548	2306	2129	2129
q6	246	180	140	140
q7	987	807	636	636
q8	9376	1677	1669	1669
q9	5343	4962	4977	4962
q10	6400	2194	1873	1873
q11	446	272	254	254
q12	647	431	296	296
q13	18174	3402	2807	2807
q14	264	260	239	239
q15	q16	823	785	710	710
q17	1007	976	989	976
q18	7205	5751	5618	5618
q19	1198	1216	1245	1216
q20	586	468	283	283
q21	5833	2815	2722	2722
q22	558	379	325	325
Total cold run time: 99751 ms
Total hot run time: 32194 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4982	4926	4856	4856
q2	q3	4999	5271	4668	4668
q4	2141	2248	1406	1406
q5	5079	4802	4706	4706
q6	262	196	135	135
q7	1957	1756	1570	1570
q8	2457	2193	2190	2190
q9	8040	7447	7573	7447
q10	4832	4718	4308	4308
q11	553	394	358	358
q12	744	750	545	545
q13	3073	3443	2783	2783
q14	273	283	267	267
q15	q16	687	704	613	613
q17	1324	1291	1284	1284
q18	7357	7078	6880	6880
q19	1129	1166	1152	1152
q20	2235	2251	1952	1952
q21	5367	4757	4449	4449
q22	511	451	416	416
Total cold run time: 58002 ms
Total hot run time: 51985 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 173195 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 2fb43c290fc4efec6b5abf6113ba820f1aed582b, data reload: false

query5	4334	656	506	506
query6	330	223	203	203
query7	4279	570	307	307
query8	337	233	224	224
query9	8854	4122	4064	4064
query10	455	348	305	305
query11	5845	2403	2231	2231
query12	186	136	126	126
query13	1275	650	454	454
query14	6241	5528	5192	5192
query14_1	4545	4558	4544	4544
query15	217	207	195	195
query16	985	430	445	430
query17	986	743	609	609
query18	2461	510	367	367
query19	236	212	174	174
query20	139	140	139	139
query21	216	142	121	121
query22	13681	13606	13541	13541
query23	17396	16644	16349	16349
query23_1	16398	16413	16469	16413
query24	7501	1791	1305	1305
query24_1	1347	1353	1347	1347
query25	579	505	444	444
query26	1309	332	181	181
query27	2678	571	356	356
query28	4412	2025	1988	1988
query29	1057	649	525	525
query30	307	242	207	207
query31	1139	1089	951	951
query32	90	81	77	77
query33	562	362	310	310
query34	1203	1144	668	668
query35	820	790	696	696
query36	1429	1462	1222	1222
query37	150	106	87	87
query38	3235	3155	3100	3100
query39	941	943	904	904
query39_1	898	870	889	870
query40	232	144	126	126
query41	66	66	64	64
query42	110	109	108	108
query43	339	327	291	291
query44	
query45	215	213	213	213
query46	1082	1224	717	717
query47	2378	2377	2272	2272
query48	378	433	329	329
query49	624	489	390	390
query50	1011	349	250	250
query51	4336	4318	4224	4224
query52	105	105	96	96
query53	256	283	207	207
query54	310	278	251	251
query55	95	92	85	85
query56	303	318	291	291
query57	1453	1440	1329	1329
query58	295	279	268	268
query59	1598	1700	1436	1436
query60	313	322	303	303
query61	160	171	159	159
query62	703	668	601	601
query63	246	203	199	199
query64	2428	809	655	655
query65	
query66	1727	493	363	363
query67	29777	29771	29591	29591
query68	
query69	462	382	317	317
query70	1036	1017	1051	1017
query71	311	269	267	267
query72	3044	2693	2673	2673
query73	872	771	462	462
query74	5157	4961	4833	4833
query75	2704	2610	2275	2275
query76	2315	1142	803	803
query77	416	416	344	344
query78	12399	12464	11888	11888
query79	1431	1078	769	769
query80	650	556	454	454
query81	452	280	246	246
query82	1412	159	124	124
query83	361	277	251	251
query84	305	158	115	115
query85	912	550	456	456
query86	401	352	321	321
query87	3423	3376	3244	3244
query88	3676	2788	2751	2751
query89	438	399	351	351
query90	1964	183	177	177
query91	180	170	142	142
query92	81	73	74	73
query93	1405	1531	897	897
query94	551	355	314	314
query95	702	390	447	390
query96	1008	839	352	352
query97	2724	2786	2597	2597
query98	236	231	232	231
query99	1210	1147	1051	1051
Total cold run time: 254827 ms
Total hot run time: 173195 ms

@Mryange

Mryange commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@Mryange

Mryange commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17693	4137	4032	4032
q2	q3	10753	1417	821	821
q4	4688	473	352	352
q5	7621	2274	2120	2120
q6	236	179	137	137
q7	946	807	635	635
q8	9347	1696	1569	1569
q9	5213	4985	4994	4985
q10	6359	2209	1886	1886
q11	427	278	244	244
q12	632	428	296	296
q13	18113	3377	2772	2772
q14	258	261	235	235
q15	q16	823	786	714	714
q17	982	974	946	946
q18	6895	5829	5662	5662
q19	1385	1354	1158	1158
q20	518	399	263	263
q21	5952	2562	2343	2343
q22	436	353	310	310
Total cold run time: 99277 ms
Total hot run time: 31480 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4409	4340	4332	4332
q2	q3	4609	4993	4337	4337
q4	2139	2242	1438	1438
q5	4445	4364	4318	4318
q6	263	287	179	179
q7	2173	1890	1659	1659
q8	2594	2251	2216	2216
q9	8283	7967	8201	7967
q10	4887	4751	4302	4302
q11	590	437	402	402
q12	793	786	549	549
q13	3298	3599	2984	2984
q14	312	301	278	278
q15	q16	738	757	655	655
q17	1396	1374	1503	1374
q18	8039	7291	7346	7291
q19	1196	1105	1098	1098
q20	2229	2221	1980	1980
q21	5303	4718	4577	4577
q22	529	462	437	437
Total cold run time: 58225 ms
Total hot run time: 52373 ms

@hello-stephen

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

query5	4315	672	517	517
query6	325	215	204	204
query7	4243	564	312	312
query8	317	232	212	212
query9	8832	4110	4093	4093
query10	450	353	301	301
query11	5809	2460	2281	2281
query12	180	128	128	128
query13	1266	600	443	443
query14	6126	5523	5235	5235
query14_1	4614	4542	4523	4523
query15	214	205	186	186
query16	1011	478	440	440
query17	964	740	620	620
query18	2476	503	365	365
query19	219	208	165	165
query20	137	137	131	131
query21	215	143	128	128
query22	13872	13681	13496	13496
query23	17392	16570	16196	16196
query23_1	16512	16465	16428	16428
query24	7611	1800	1343	1343
query24_1	1357	1323	1310	1310
query25	582	514	455	455
query26	1323	315	183	183
query27	2676	568	364	364
query28	4539	1987	1971	1971
query29	979	650	507	507
query30	306	237	205	205
query31	1114	1079	955	955
query32	86	82	73	73
query33	534	350	301	301
query34	1188	1194	656	656
query35	759	814	678	678
query36	1398	1431	1242	1242
query37	151	105	90	90
query38	3248	3181	3089	3089
query39	914	914	905	905
query39_1	875	884	878	878
query40	242	145	124	124
query41	68	63	63	63
query42	111	109	109	109
query43	337	341	297	297
query44	
query45	216	200	199	199
query46	1123	1215	724	724
query47	2359	2448	2257	2257
query48	408	421	302	302
query49	623	480	391	391
query50	952	352	253	253
query51	4340	4304	4278	4278
query52	104	106	97	97
query53	249	292	210	210
query54	309	270	250	250
query55	92	89	88	88
query56	306	311	297	297
query57	1430	1440	1346	1346
query58	296	263	265	263
query59	1603	1654	1435	1435
query60	319	330	315	315
query61	163	166	154	154
query62	696	667	606	606
query63	242	195	204	195
query64	2403	801	635	635
query65	
query66	1721	475	350	350
query67	29147	29726	29610	29610
query68	
query69	468	336	300	300
query70	1029	979	994	979
query71	311	312	268	268
query72	3033	2712	2549	2549
query73	867	778	448	448
query74	5104	4986	4811	4811
query75	2711	2615	2285	2285
query76	2285	1139	798	798
query77	410	413	340	340
query78	12298	12570	11762	11762
query79	1440	1074	749	749
query80	642	574	460	460
query81	462	283	247	247
query82	1406	154	124	124
query83	347	283	247	247
query84	311	144	112	112
query85	903	536	453	453
query86	387	333	322	322
query87	3423	3401	3261	3261
query88	3637	2736	2738	2736
query89	434	403	341	341
query90	1962	184	177	177
query91	182	172	139	139
query92	83	80	75	75
query93	1525	1576	897	897
query94	542	363	311	311
query95	692	390	353	353
query96	1087	783	343	343
query97	2778	2726	2610	2610
query98	242	229	231	229
query99	1190	1152	1036	1036
Total cold run time: 253938 ms
Total hot run time: 172542 ms

@Mryange

Mryange commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@Mryange Mryange force-pushed the refine-array-map-strong-type-offset branch from 26028c3 to 072a404 Compare May 27, 2026 03:54
@Mryange

Mryange commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17668	4044	4024	4024
q2	q3	10759	1397	819	819
q4	4687	475	343	343
q5	7573	2291	2156	2156
q6	242	177	145	145
q7	943	795	637	637
q8	9567	1746	1599	1599
q9	5356	5021	5003	5003
q10	6406	2238	1895	1895
q11	428	275	252	252
q12	651	433	299	299
q13	18131	3443	2789	2789
q14	271	260	239	239
q15	q16	822	777	718	718
q17	1037	938	966	938
q18	6919	5660	5448	5448
q19	1182	1215	1022	1022
q20	668	459	306	306
q21	6137	2846	2697	2697
q22	475	527	328	328
Total cold run time: 99922 ms
Total hot run time: 31657 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4815	4777	4666	4666
q2	q3	4953	5293	4676	4676
q4	2130	2156	1394	1394
q5	4935	4765	4674	4674
q6	237	177	125	125
q7	1944	1795	1575	1575
q8	2436	2118	2138	2118
q9	7991	7636	7439	7439
q10	4768	4683	4234	4234
q11	555	387	352	352
q12	730	738	539	539
q13	3000	3388	2806	2806
q14	281	275	255	255
q15	q16	677	711	606	606
q17	1297	1264	1248	1248
q18	7421	6944	6875	6875
q19	1129	1082	1121	1082
q20	2232	2231	1954	1954
q21	5307	4614	4403	4403
q22	512	480	403	403
Total cold run time: 57350 ms
Total hot run time: 51424 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 171953 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 072a4042d1894fa9863d738e087225c8a2dea569, data reload: false

query5	4357	662	535	535
query6	325	217	196	196
query7	4258	580	300	300
query8	333	237	214	214
query9	8787	4073	4081	4073
query10	436	341	306	306
query11	5797	2532	2254	2254
query12	177	126	124	124
query13	1259	605	427	427
query14	6076	5446	5136	5136
query14_1	4476	4477	4470	4470
query15	218	205	185	185
query16	1004	446	422	422
query17	1149	720	599	599
query18	2438	478	363	363
query19	222	207	172	172
query20	141	132	133	132
query21	216	143	122	122
query22	13680	13613	13413	13413
query23	17314	16649	16265	16265
query23_1	16255	16462	16404	16404
query24	7439	1796	1316	1316
query24_1	1320	1351	1361	1351
query25	569	501	455	455
query26	1319	341	177	177
query27	2694	586	345	345
query28	4494	2031	2024	2024
query29	1048	661	542	542
query30	306	244	200	200
query31	1139	1085	944	944
query32	92	81	77	77
query33	558	376	312	312
query34	1194	1150	681	681
query35	797	812	705	705
query36	1387	1461	1237	1237
query37	153	111	89	89
query38	3198	3151	3072	3072
query39	951	915	896	896
query39_1	878	882	863	863
query40	241	151	129	129
query41	73	70	68	68
query42	120	112	115	112
query43	341	355	304	304
query44	
query45	229	211	203	203
query46	1098	1244	741	741
query47	2396	2337	2255	2255
query48	417	439	309	309
query49	652	515	417	417
query50	1026	363	263	263
query51	4382	4309	4276	4276
query52	105	110	98	98
query53	266	283	212	212
query54	341	292	270	270
query55	95	94	87	87
query56	311	331	311	311
query57	1461	1441	1347	1347
query58	319	287	277	277
query59	1627	1748	1463	1463
query60	319	319	302	302
query61	159	156	159	156
query62	702	646	587	587
query63	240	202	208	202
query64	2443	795	672	672
query65	
query66	1711	478	361	361
query67	29803	29623	28934	28934
query68	
query69	472	340	300	300
query70	1036	977	972	972
query71	316	277	268	268
query72	2934	2746	2452	2452
query73	824	750	445	445
query74	5103	5010	4796	4796
query75	2705	2623	2274	2274
query76	2310	1167	792	792
query77	410	416	340	340
query78	12343	12439	11804	11804
query79	1416	1044	821	821
query80	660	573	471	471
query81	459	288	246	246
query82	1390	167	132	132
query83	350	288	254	254
query84	266	152	123	123
query85	937	568	472	472
query86	414	356	313	313
query87	3426	3392	3259	3259
query88	3627	2807	2774	2774
query89	445	388	349	349
query90	1934	187	186	186
query91	184	175	146	146
query92	83	77	73	73
query93	1518	1534	869	869
query94	532	345	324	324
query95	698	477	353	353
query96	1138	772	338	338
query97	2736	2741	2628	2628
query98	235	231	233	231
query99	1186	1153	1026	1026
Total cold run time: 254134 ms
Total hot run time: 171953 ms

@Mryange

Mryange commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17702	4097	4112	4097
q2	q3	10780	1439	867	867
q4	4690	480	352	352
q5	7600	2272	2133	2133
q6	241	184	143	143
q7	963	807	644	644
q8	9343	1682	1684	1682
q9	5250	5031	4998	4998
q10	6364	2212	1997	1997
q11	451	275	246	246
q12	631	424	304	304
q13	18163	3396	2800	2800
q14	266	258	243	243
q15	q16	816	771	706	706
q17	1006	938	980	938
q18	7214	5767	5470	5470
q19	1307	1296	1112	1112
q20	538	417	272	272
q21	5905	2675	2396	2396
q22	448	363	303	303
Total cold run time: 99678 ms
Total hot run time: 31703 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4459	4381	4454	4381
q2	q3	4554	4929	4317	4317
q4	2130	2206	1382	1382
q5	4470	4372	4631	4372
q6	268	223	171	171
q7	2188	1982	1743	1743
q8	2568	2353	2292	2292
q9	8350	8067	8118	8067
q10	4845	4776	4343	4343
q11	621	453	411	411
q12	767	789	559	559
q13	3294	3652	2977	2977
q14	293	307	277	277
q15	q16	697	746	643	643
q17	1392	1526	1360	1360
q18	7973	7322	7274	7274
q19	1204	1084	1114	1084
q20	2225	2232	1949	1949
q21	5344	4643	4510	4510
q22	522	484	414	414
Total cold run time: 58164 ms
Total hot run time: 52526 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 170872 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 26909acbda9f3166349d8f7e6971af1f05c0fb5f, data reload: false

query5	4315	679	540	540
query6	332	220	211	211
query7	4411	568	318	318
query8	344	256	221	221
query9	8756	4077	4084	4077
query10	447	340	303	303
query11	5772	2448	2285	2285
query12	189	133	124	124
query13	1280	634	438	438
query14	6148	5488	5141	5141
query14_1	4488	4448	4450	4448
query15	219	202	182	182
query16	1026	483	466	466
query17	1104	710	587	587
query18	2722	473	355	355
query19	215	198	160	160
query20	137	130	128	128
query21	214	138	114	114
query22	13617	13546	13406	13406
query23	17356	16567	16156	16156
query23_1	16275	16255	16368	16255
query24	7409	1758	1333	1333
query24_1	1322	1303	1340	1303
query25	556	489	440	440
query26	1310	313	178	178
query27	2700	576	346	346
query28	4415	1993	1975	1975
query29	973	644	523	523
query30	301	238	207	207
query31	1145	1103	951	951
query32	95	79	73	73
query33	569	373	305	305
query34	1176	1202	650	650
query35	765	790	693	693
query36	1405	1466	1283	1283
query37	152	102	93	93
query38	3201	3167	3052	3052
query39	931	917	886	886
query39_1	874	876	880	876
query40	241	146	123	123
query41	66	63	62	62
query42	111	116	121	116
query43	328	339	289	289
query44	
query45	219	203	204	203
query46	1083	1204	714	714
query47	2329	2358	2241	2241
query48	401	415	299	299
query49	626	488	382	382
query50	1060	361	266	266
query51	4328	4308	4267	4267
query52	107	105	97	97
query53	249	286	198	198
query54	307	268	263	263
query55	92	93	86	86
query56	290	299	298	298
query57	1449	1418	1305	1305
query58	288	270	267	267
query59	1571	1641	1466	1466
query60	322	327	295	295
query61	154	156	146	146
query62	695	649	591	591
query63	250	201	208	201
query64	2368	821	635	635
query65	
query66	1663	461	402	402
query67	29757	29626	29033	29033
query68	
query69	468	348	310	310
query70	1038	946	1010	946
query71	315	274	267	267
query72	2939	2655	2406	2406
query73	828	771	442	442
query74	5126	4956	4766	4766
query75	2681	2596	2276	2276
query76	2310	1150	805	805
query77	420	414	344	344
query78	12498	12452	11852	11852
query79	1233	1049	741	741
query80	604	530	454	454
query81	460	280	245	245
query82	233	155	125	125
query83	279	282	249	249
query84	255	142	111	111
query85	861	523	454	454
query86	367	341	306	306
query87	3432	3391	3245	3245
query88	3675	2752	2695	2695
query89	430	385	343	343
query90	2191	193	179	179
query91	179	160	147	147
query92	82	81	76	76
query93	1537	1401	890	890
query94	543	345	312	312
query95	685	401	352	352
query96	1098	854	348	348
query97	2711	2740	2628	2628
query98	235	225	229	225
query99	1151	1175	1011	1011
Total cold run time: 252759 ms
Total hot run time: 170872 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 83.33% (105/126) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.88% (20923/38834)
Line Coverage 37.43% (198136/529287)
Region Coverage 33.69% (155106/460343)
Branch Coverage 34.72% (67563/194620)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 92.74% (115/124) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.87% (28096/38034)
Line Coverage 57.81% (305191/527931)
Region Coverage 55.11% (256147/464766)
Branch Coverage 56.50% (110366/195346)

@Mryange

Mryange commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@Mryange

Mryange commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17646	4098	4145	4098
q2	q3	10807	1441	805	805
q4	4685	488	348	348
q5	7622	2306	2120	2120
q6	242	180	139	139
q7	968	791	662	662
q8	9367	1773	1717	1717
q9	5361	5052	5067	5052
q10	6384	2195	1871	1871
q11	450	274	253	253
q12	632	437	293	293
q13	18113	3395	2793	2793
q14	272	261	247	247
q15	q16	827	786	708	708
q17	1010	962	1022	962
q18	6997	5723	5552	5552
q19	1322	1269	1179	1179
q20	566	454	283	283
q21	6376	2862	2597	2597
q22	495	375	310	310
Total cold run time: 100142 ms
Total hot run time: 31989 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4816	4766	4740	4740
q2	q3	5047	5356	4583	4583
q4	2106	2220	1395	1395
q5	5143	4703	4680	4680
q6	244	182	128	128
q7	1923	1774	1563	1563
q8	2480	2145	2150	2145
q9	7999	7453	7481	7453
q10	4731	4688	4199	4199
q11	543	404	367	367
q12	737	746	525	525
q13	3134	3424	2830	2830
q14	271	275	272	272
q15	q16	675	705	622	622
q17	1314	1281	1271	1271
q18	7378	6831	6910	6831
q19	1139	1120	1102	1102
q20	2224	2218	1961	1961
q21	5343	4605	4483	4483
q22	546	462	410	410
Total cold run time: 57793 ms
Total hot run time: 51560 ms

@hello-stephen

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

query5	4371	668	537	537
query6	342	238	200	200
query7	4223	571	287	287
query8	321	258	235	235
query9	8795	4173	4153	4153
query10	469	404	307	307
query11	5806	2586	2191	2191
query12	185	130	128	128
query13	1297	642	425	425
query14	6086	5417	5156	5156
query14_1	4473	4456	4519	4456
query15	220	209	184	184
query16	1021	467	431	431
query17	949	729	585	585
query18	2457	491	362	362
query19	216	197	163	163
query20	139	133	129	129
query21	214	139	118	118
query22	13754	13572	13476	13476
query23	17420	16504	16176	16176
query23_1	16394	16365	16414	16365
query24	7513	1788	1320	1320
query24_1	1344	1319	1357	1319
query25	598	501	430	430
query26	1315	346	176	176
query27	2661	566	353	353
query28	4499	2020	2013	2013
query29	1015	670	531	531
query30	307	243	204	204
query31	1141	1091	978	978
query32	94	83	75	75
query33	548	367	337	337
query34	1169	1146	675	675
query35	795	817	708	708
query36	1434	1429	1210	1210
query37	162	114	95	95
query38	3187	3180	3086	3086
query39	933	914	903	903
query39_1	879	871	887	871
query40	235	150	130	130
query41	71	67	68	67
query42	116	114	116	114
query43	336	334	299	299
query44	
query45	214	212	206	206
query46	1114	1213	738	738
query47	2386	2378	2272	2272
query48	421	424	314	314
query49	649	510	407	407
query50	1017	348	257	257
query51	4360	4329	4228	4228
query52	109	109	97	97
query53	263	287	210	210
query54	339	292	283	283
query55	96	94	88	88
query56	317	327	336	327
query57	1425	1435	1350	1350
query58	326	289	278	278
query59	1611	1668	1475	1475
query60	331	329	314	314
query61	166	156	163	156
query62	696	647	576	576
query63	252	203	212	203
query64	2423	810	670	670
query65	
query66	1704	481	370	370
query67	29827	29691	28916	28916
query68	
query69	469	348	300	300
query70	1034	1041	1037	1037
query71	304	275	277	275
query72	3016	2781	2505	2505
query73	815	761	446	446
query74	5166	4970	4803	4803
query75	2687	2607	2267	2267
query76	2278	1158	785	785
query77	417	412	346	346
query78	12417	12454	11891	11891
query79	1400	977	754	754
query80	650	549	459	459
query81	450	285	246	246
query82	1409	156	124	124
query83	371	274	258	258
query84	307	144	112	112
query85	885	542	480	480
query86	407	368	333	333
query87	3452	3406	3276	3276
query88	3618	2739	2718	2718
query89	444	403	348	348
query90	1942	181	186	181
query91	185	172	146	146
query92	86	82	75	75
query93	1454	1497	820	820
query94	542	358	321	321
query95	689	491	355	355
query96	1040	800	325	325
query97	2723	2719	2620	2620
query98	238	232	240	232
query99	1168	1149	1039	1039
Total cold run time: 254627 ms
Total hot run time: 171928 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 83.06% (103/124) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.92% (20953/38860)
Line Coverage 37.48% (198586/529799)
Region Coverage 33.76% (155544/460740)
Branch Coverage 34.77% (67746/194867)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 92.62% (113/122) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.85% (28106/38058)
Line Coverage 57.80% (305418/528428)
Region Coverage 54.96% (255674/465160)
Branch Coverage 56.47% (110461/195593)

@Mryange Mryange force-pushed the refine-array-map-strong-type-offset branch from a66ed0f to e11b51c Compare May 28, 2026 02:46
@Mryange

Mryange commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review result: no blocking issues found in the reviewable PR diff.

Critical checkpoint conclusions:

  • Goal/test: The PR focuses on strongly typing ColumnArray/ColumnMap offset subcolumns and removing redundant casts. Existing column unit tests are updated; no new behavior-specific test is required for this refactor, though CI should still run BE UTs for the touched column paths.
  • Scope/minimality: The reviewable GitHub diff is focused on Array/Map offset ownership/accessors, deserialize/write-back paths, and direct callers.
  • Concurrency: No new shared concurrent state or locks are introduced in the reviewable diff.
  • Lifecycle/COW: The typed WrappedPtr conversions and defer-based generic callback bridging follow the existing ColumnNullable pattern; storage reader write-back keeps offsets restored on early return.
  • Configuration/incompatibility: No new config, storage format, or wire-format changes in the reviewable diff.
  • Parallel paths: Array and Map paths are both updated; function/lambda callers using offsets were adjusted consistently.
  • Error handling: Existing invariant checks are preserved via typed asserts/casts; no ignored Status introduced.
  • Memory/performance: No new large untracked allocations; the change removes repeated casts and should not add hot-path overhead.
  • Observability: No new runtime behavior requiring logs or metrics.
  • Data correctness/versioning/MoW: No transaction, version visibility, delete bitmap, or MoW write-path logic is changed.

User focus: no additional user-provided review focus was present.

@Mryange

Mryange commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 83.06% (103/124) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.95% (20967/38861)
Line Coverage 37.54% (198906/529847)
Region Coverage 33.80% (155772/460820)
Branch Coverage 34.79% (67804/194891)

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	18109	4100	3971	3971
q2	q3	10786	1476	847	847
q4	4712	486	350	350
q5	8218	2295	2081	2081
q6	303	175	147	147
q7	992	814	626	626
q8	9348	1875	1621	1621
q9	7167	4985	4954	4954
q10	6445	2271	1883	1883
q11	447	268	242	242
q12	691	432	303	303
q13	18215	3411	2793	2793
q14	272	256	235	235
q15	q16	819	773	713	713
q17	974	973	936	936
q18	7262	5710	5647	5647
q19	1203	1394	1115	1115
q20	502	399	267	267
q21	6052	2769	2581	2581
q22	450	387	324	324
Total cold run time: 102967 ms
Total hot run time: 31636 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4803	4972	4617	4617
q2	q3	4957	5284	4596	4596
q4	2101	2197	1403	1403
q5	4982	4608	4701	4608
q6	238	177	135	135
q7	1916	1731	1544	1544
q8	2249	1970	1974	1970
q9	7423	7415	7418	7415
q10	4768	4736	4302	4302
q11	537	384	358	358
q12	823	747	531	531
q13	3078	3475	2793	2793
q14	270	294	254	254
q15	q16	665	695	608	608
q17	1296	1254	1247	1247
q18	7349	7000	6866	6866
q19	1108	1118	1129	1118
q20	2237	2224	1948	1948
q21	5285	4559	4439	4439
q22	545	462	404	404
Total cold run time: 56630 ms
Total hot run time: 51156 ms

@hello-stephen

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

query5	4344	664	523	523
query6	325	219	202	202
query7	4339	573	307	307
query8	330	237	219	219
query9	8833	4154	4137	4137
query10	464	341	308	308
query11	5860	2600	2248	2248
query12	193	131	127	127
query13	1303	625	432	432
query14	6169	5523	5183	5183
query14_1	4554	4546	4501	4501
query15	220	220	189	189
query16	1021	454	465	454
query17	1140	762	614	614
query18	2468	519	377	377
query19	232	206	165	165
query20	137	134	136	134
query21	223	142	119	119
query22	13728	13627	13441	13441
query23	17441	16660	16200	16200
query23_1	16424	16311	16364	16311
query24	7457	1790	1342	1342
query24_1	1340	1341	1334	1334
query25	597	514	451	451
query26	1310	328	181	181
query27	2691	570	354	354
query28	4447	2062	2033	2033
query29	1023	661	533	533
query30	315	244	201	201
query31	1126	1090	957	957
query32	95	81	80	80
query33	552	376	321	321
query34	1205	1176	681	681
query35	800	815	719	719
query36	1401	1456	1281	1281
query37	156	109	94	94
query38	3225	3127	3128	3127
query39	946	924	894	894
query39_1	873	876	902	876
query40	237	146	125	125
query41	65	62	62	62
query42	108	107	114	107
query43	337	332	296	296
query44	
query45	218	206	196	196
query46	1093	1187	742	742
query47	2319	2369	2230	2230
query48	404	432	315	315
query49	664	505	387	387
query50	977	352	256	256
query51	4415	4409	4359	4359
query52	107	106	95	95
query53	258	279	219	219
query54	318	285	262	262
query55	98	94	90	90
query56	318	334	317	317
query57	1443	1424	1316	1316
query58	303	281	278	278
query59	1581	1662	1471	1471
query60	333	330	329	329
query61	207	157	158	157
query62	697	655	584	584
query63	249	203	207	203
query64	2419	810	654	654
query65	
query66	1715	482	364	364
query67	29947	29889	29714	29714
query68	
query69	462	356	318	318
query70	1036	1059	1047	1047
query71	305	285	277	277
query72	3007	2776	2488	2488
query73	900	792	435	435
query74	5126	4993	4843	4843
query75	2705	2652	2280	2280
query76	2334	1184	796	796
query77	414	415	331	331
query78	12368	12733	11923	11923
query79	1470	1111	726	726
query80	1005	540	472	472
query81	499	292	241	241
query82	1334	168	131	131
query83	344	282	255	255
query84	268	143	118	118
query85	915	548	469	469
query86	464	348	334	334
query87	3470	3423	3263	3263
query88	3694	2792	2748	2748
query89	453	397	345	345
query90	1792	192	178	178
query91	182	186	144	144
query92	81	82	74	74
query93	1591	1422	808	808
query94	635	343	308	308
query95	666	391	438	391
query96	1040	759	361	361
query97	2749	2736	2568	2568
query98	244	233	226	226
query99	1174	1153	1026	1026
Total cold run time: 255769 ms
Total hot run time: 173041 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 92.62% (113/122) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.89% (28124/38060)
Line Coverage 57.84% (305662/528491)
Region Coverage 54.84% (255123/465235)
Branch Coverage 56.46% (110444/195617)

const ColumnPtr& get_offsets_ptr() const { return offsets; }
ColumnPtr& get_offsets_ptr() { return offsets; }
const ColumnOffsets::Ptr& get_offsets_ptr() const {
return static_cast<const ColumnOffsets::Ptr&>(offsets);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这里需要显式static_cast吗?我感觉不需要啊,反而看起来很复杂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这个chameleon_ptr 和 Ptr不是同一个类型。

    template <typename T>
    class chameleon_ptr {
    private:
        immutable_ptr<T> value;
        operator const immutable_ptr<T>&() const { return value; }
        operator immutable_ptr<T>&() { return value; }

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@Mryange Mryange merged commit 2ad56a8 into apache:master Jun 1, 2026
32 of 33 checks passed
zhaorongsheng pushed a commit to zhaorongsheng/doris that referenced this pull request Jun 4, 2026
### What problem does this PR solve?

Array and map offset subcolumns were still stored and exposed through
generic IColumn pointers, so callers had to repeatedly downcast them
back to their concrete offset column types. Root cause: the ownership,
COW mutation, deserialization, and segment reader write-back paths still
treated these offsets as generic subcolumns, which left the
strong-typing change incomplete and kept redundant same-type assert_cast
usage in affected callers and tests. This change promotes ColumnArray
offsets and ColumnMap offsets_column to typed wrapped pointers, updates
the typed accessors and generic write-back paths to preserve the
concrete offset column type, and removes the now-redundant casts in
array functions, lambda functions, and unit tests. It also cleans up one
redundant nullable null-map cast uncovered during the BE UT compile.
### Release note

None
yiguolei pushed a commit that referenced this pull request Jun 30, 2026
### What problem does this PR solve?


Related PR: #63491, #63678, #63946, #58092

Problem Summary:

Backport the column strong-typing refinements for branch-4.1: use strong
typed nullable null maps, array offsets, and map offsets, and apply the
column check helper for type casts. Branch-4.1 was missing the
COW/Column cast helper introduced by #58092, so this also ports the
minimal helper API needed by the picked changes and adjusts an old array
distance code path to use the already strong typed offsets pointer.
### 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)
    - [ ] 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 <!-- Add your reason?  -->

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

- Does this need documentation?
    - [ ] 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.1.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants