Skip to content

[fix](iceberg) Honor partial name mappings for legacy files#65784

Open
Gabriel39 wants to merge 7 commits into
apache:masterfrom
Gabriel39:ai/doris-27020-strict-partial-name-mapping
Open

[fix](iceberg) Honor partial name mappings for legacy files#65784
Gabriel39 wants to merge 7 commits into
apache:masterfrom
Gabriel39:ai/doris-27020-strict-partial-name-mapping

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: Legacy Iceberg Parquet and ORC files without field IDs are resolved through name mapping. With a partial mapping, FE omitted the optional mapping metadata for unmapped fields, so both V1 and V2 BE readers fell back to the current physical name and read unrelated data.

This change preserves table-level mapping presence by transporting explicit empty per-field lists and makes those lists authoritative in both readers. Unmapped fields now materialize their default or NULL, while mapped aliases and scans without name mapping retain their existing behavior.

Release note

Fix reads of migrated Iceberg files with partial name mapping so fields omitted from the mapping materialize their default value or NULL instead of matching a physical column by the current name.

Check List (For Author)

  • Test: Unit Test
    • ExternalUtilTest (6 tests)
    • Focused V1 and V2 name-mapping BE unit tests under ASAN (10 tests)
  • Behavior changed: Yes. Partial Iceberg name mappings are now authoritative for legacy files without field IDs.
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: Legacy Iceberg Parquet and ORC files without field IDs are resolved through name mapping. With a partial mapping, FE omitted the optional mapping metadata for unmapped fields, so both V1 and V2 BE readers fell back to the current physical name and read unrelated data. Preserve table-level mapping presence by transporting explicit empty per-field lists and make those lists authoritative in both readers, so unmapped fields materialize their default or NULL while mapped aliases and scans without name mapping retain their existing behavior.

### Release note

Fix reads of migrated Iceberg files with partial name mapping so fields omitted from the mapping materialize their default value or NULL instead of matching a physical column by the current name.

### Check List (For Author)

- Test: Unit Test
    - ExternalUtilTest
    - Focused V1 and V2 name-mapping BE unit tests under ASAN
- Behavior changed: Yes. Partial Iceberg name mappings are now authoritative for legacy files without field IDs.
- Does this need documentation: No
@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?

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39
Gabriel39 marked this pull request as ready for review July 18, 2026 13:03
@Gabriel39
Gabriel39 requested a review from yiguolei as a code owner July 18, 2026 13:03
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17697	4015	4010	4010
q2	2031	317	197	197
q3	10257	1418	797	797
q4	4686	465	340	340
q5	7491	831	558	558
q6	176	170	136	136
q7	726	824	616	616
q8	9939	1499	1520	1499
q9	6239	4341	4346	4341
q10	6825	1734	1456	1456
q11	515	361	317	317
q12	732	570	452	452
q13	18119	3314	2726	2726
q14	267	258	248	248
q15	q16	782	777	701	701
q17	1037	1030	1094	1030
q18	6712	5729	5420	5420
q19	1516	1358	1047	1047
q20	784	668	541	541
q21	5957	2627	2274	2274
q22	424	352	292	292
Total cold run time: 102912 ms
Total hot run time: 28998 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4412	4373	4386	4373
q2	309	319	213	213
q3	4679	5034	4400	4400
q4	2049	2180	1366	1366
q5	4368	4246	4242	4242
q6	236	181	122	122
q7	1715	2077	1730	1730
q8	2454	2176	2134	2134
q9	7792	7679	7691	7679
q10	4680	4654	4214	4214
q11	629	407	369	369
q12	868	834	576	576
q13	3303	3572	2945	2945
q14	316	307	259	259
q15	q16	721	722	648	648
q17	1333	1334	1295	1295
q18	7983	7339	6860	6860
q19	1128	1080	1061	1061
q20	2229	2190	1944	1944
q21	5213	4492	4420	4420
q22	523	455	402	402
Total cold run time: 56940 ms
Total hot run time: 51252 ms

@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 completed against the current head after three convergence rounds. Two blocking correctness issues remain.

Checkpoint conclusions:

  • Goal/minimality: the patch fixes top-level non-empty partial mappings, but the same authoritative-presence contract is incomplete for nested V2 projections and for a present globally empty mapping. The changes are otherwise focused.
  • Flow/parallel paths: traced FE extraction and Thrift transport through V1 Parquet/ORC, V2 field-id/BY_NAME mapping, nested projection, equality-delete hidden dependencies, and position-delete/deletion-vector paths. No additional reachable defect survived convergence.
  • Compatibility/state: no wire type, persisted format, configuration, concurrency, locking, lifecycle, or ownership contract changes were introduced. Mixed-version descriptors retain the pre-existing behavior rather than creating a new serialization incompatibility.
  • Tests: the added tests cover scalar top-level non-empty partial mappings, but not whole/pruned nested materialization or absent-versus-present-[] transport/results.
  • Performance/observability: the added metadata bit has negligible cost and is included in debug output; no per-row hot-path regression was found.
  • Validation: static review only, as required by the review task. Remote compile, CheckStyle, clang-format, license, secret, and dependency checks pass. The macOS BE UT workflow failed because it selected JDK 25 while the build requires JDK 17; Doris BE/FE and regression jobs were still running at submission.

Requesting changes because both findings can silently bind unrelated legacy values instead of producing the Iceberg initial default/NULL.

Comment thread be/src/format_v2/table_reader.cpp
Comment thread fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalUtil.java Outdated
@hello-stephen

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

query5	4312	618	476	476
query6	475	230	215	215
query7	4858	566	333	333
query8	338	189	177	177
query9	8809	4046	4061	4046
query10	474	373	305	305
query11	6117	2354	2126	2126
query12	162	103	104	103
query13	1323	606	436	436
query14	6576	5221	4932	4932
query14_1	4285	4259	4251	4251
query15	219	212	185	185
query16	1016	467	405	405
query17	1128	715	584	584
query18	2717	482	347	347
query19	217	189	149	149
query20	114	109	108	108
query21	240	156	134	134
query22	13552	13613	13430	13430
query23	17286	16503	16084	16084
query23_1	16233	16262	16202	16202
query24	7454	1730	1292	1292
query24_1	1317	1248	1247	1247
query25	586	479	396	396
query26	1330	354	223	223
query27	2615	602	381	381
query28	4458	1983	2009	1983
query29	1157	630	508	508
query30	344	273	233	233
query31	1117	1090	975	975
query32	114	63	63	63
query33	536	313	256	256
query34	1149	1127	665	665
query35	761	797	663	663
query36	1193	1190	1094	1094
query37	152	104	87	87
query38	1892	1699	1666	1666
query39	887	871	831	831
query39_1	825	840	882	840
query40	247	163	142	142
query41	64	61	62	61
query42	96	93	90	90
query43	326	323	285	285
query44	1409	781	756	756
query45	195	187	172	172
query46	1047	1216	714	714
query47	2126	2099	2042	2042
query48	411	387	302	302
query49	583	414	307	307
query50	1040	440	339	339
query51	10528	10835	10537	10537
query52	85	87	79	79
query53	261	279	201	201
query54	281	234	219	219
query55	78	70	65	65
query56	310	287	289	287
query57	1326	1300	1257	1257
query58	287	269	236	236
query59	1558	1640	1424	1424
query60	338	272	276	272
query61	146	148	146	146
query62	535	496	428	428
query63	240	204	204	204
query64	2759	1026	888	888
query65	4715	4682	4645	4645
query66	1780	526	381	381
query67	29408	29263	29087	29087
query68	3043	1475	966	966
query69	400	287	300	287
query70	1054	974	942	942
query71	382	343	316	316
query72	3003	2667	2319	2319
query73	850	737	440	440
query74	5068	4911	4687	4687
query75	2521	2503	2136	2136
query76	2368	1176	765	765
query77	349	375	284	284
query78	11927	11937	11290	11290
query79	1478	1156	730	730
query80	1296	550	461	461
query81	576	332	283	283
query82	606	159	126	126
query83	373	331	298	298
query84	281	168	131	131
query85	987	625	519	519
query86	436	287	274	274
query87	1824	1825	1756	1756
query88	3733	2805	2778	2778
query89	434	374	318	318
query90	1910	193	198	193
query91	197	187	161	161
query92	59	61	52	52
query93	1663	1463	999	999
query94	740	352	308	308
query95	771	515	477	477
query96	1061	852	351	351
query97	2625	2630	2474	2474
query98	217	212	202	202
query99	1105	1114	976	976
Total cold run time: 264178 ms
Total hot run time: 177114 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.04	0.05
query3	0.26	0.14	0.13
query4	1.62	0.13	0.14
query5	0.24	0.22	0.22
query6	1.29	1.05	1.05
query7	0.04	0.00	0.00
query8	0.06	0.04	0.03
query9	0.37	0.33	0.33
query10	0.57	0.55	0.54
query11	0.19	0.14	0.15
query12	0.19	0.14	0.14
query13	0.45	0.47	0.47
query14	1.02	1.01	1.02
query15	0.61	0.59	0.60
query16	0.31	0.33	0.32
query17	1.11	1.07	1.09
query18	0.22	0.20	0.20
query19	2.03	1.92	1.98
query20	0.02	0.02	0.01
query21	15.41	0.19	0.13
query22	4.93	0.06	0.05
query23	16.16	0.31	0.11
query24	3.08	0.42	0.31
query25	0.12	0.05	0.03
query26	0.74	0.21	0.14
query27	0.05	0.03	0.03
query28	3.51	0.97	0.54
query29	12.49	4.12	3.29
query30	0.28	0.15	0.15
query31	2.77	0.60	0.30
query32	3.23	0.59	0.49
query33	3.18	3.22	3.18
query34	15.65	4.20	3.52
query35	3.51	3.50	3.53
query36	0.56	0.43	0.43
query37	0.10	0.06	0.07
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.19	0.16	0.16
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.9 s
Total hot run time: 24.91 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (13/13) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.44% (23945/41688)
Line Coverage 41.17% (235514/572026)
Region Coverage 37.00% (186115/502950)
Branch Coverage 38.20% (83567/218786)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (13/13) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.41% (29854/40666)
Line Coverage 57.24% (325419/568507)
Region Coverage 53.73% (271233/504842)
Branch Coverage 54.66% (119658/218928)

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17630	4132	4081	4081
q2	1992	334	211	211
q3	10262	1418	841	841
q4	4677	467	336	336
q5	7477	835	553	553
q6	189	183	141	141
q7	754	818	615	615
q8	9786	1670	1537	1537
q9	6167	4312	4313	4312
q10	6808	1743	1477	1477
q11	513	347	319	319
q12	745	578	459	459
q13	18120	3346	2728	2728
q14	266	279	247	247
q15	q16	787	778	711	711
q17	1036	935	908	908
q18	6925	5781	5479	5479
q19	1364	1284	1057	1057
q20	789	725	643	643
q21	5862	2602	2454	2454
q22	440	368	294	294
Total cold run time: 102589 ms
Total hot run time: 29403 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4466	4381	4321	4321
q2	281	313	208	208
q3	4584	4938	4413	4413
q4	2074	2148	1371	1371
q5	4429	4339	4331	4331
q6	233	177	134	134
q7	1725	2177	1736	1736
q8	2504	2206	2228	2206
q9	7888	7689	7721	7689
q10	4680	4666	4188	4188
q11	566	425	385	385
q12	860	816	530	530
q13	3346	3534	3072	3072
q14	304	316	278	278
q15	q16	690	722	665	665
q17	1363	1332	1341	1332
q18	7947	7330	6873	6873
q19	1137	1074	1073	1073
q20	2214	2211	1935	1935
q21	5231	4563	4509	4509
q22	505	455	424	424
Total cold run time: 57027 ms
Total hot run time: 51673 ms

@hello-stephen

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

query5	4321	615	495	495
query6	469	225	213	213
query7	4844	608	350	350
query8	332	184	167	167
query9	8808	4035	4056	4035
query10	479	381	312	312
query11	5926	2342	2139	2139
query12	154	104	103	103
query13	1281	601	425	425
query14	6256	5178	4876	4876
query14_1	4203	4219	4256	4219
query15	210	201	181	181
query16	1008	477	456	456
query17	1135	746	566	566
query18	2486	495	348	348
query19	207	227	148	148
query20	115	113	113	113
query21	229	159	138	138
query22	13443	13647	13234	13234
query23	17280	16482	16113	16113
query23_1	16200	16280	16195	16195
query24	7680	1753	1276	1276
query24_1	1331	1280	1282	1280
query25	578	458	385	385
query26	1350	363	216	216
query27	2676	576	385	385
query28	4431	2015	1986	1986
query29	1100	615	500	500
query30	339	264	233	233
query31	1114	1094	1001	1001
query32	109	59	58	58
query33	506	313	237	237
query34	1152	1153	639	639
query35	753	802	661	661
query36	1169	1163	1054	1054
query37	154	104	94	94
query38	1873	1700	1672	1672
query39	870	866	848	848
query39_1	842	836	835	835
query40	245	168	139	139
query41	69	64	62	62
query42	92	94	96	94
query43	327	321	275	275
query44	1418	753	737	737
query45	188	184	175	175
query46	1060	1162	726	726
query47	2132	2173	1997	1997
query48	384	391	295	295
query49	574	420	301	301
query50	1065	441	335	335
query51	10449	10571	10577	10571
query52	86	87	75	75
query53	258	279	199	199
query54	275	223	218	218
query55	76	71	68	68
query56	319	295	288	288
query57	1318	1281	1209	1209
query58	272	270	252	252
query59	1556	1639	1434	1434
query60	293	270	259	259
query61	150	148	142	142
query62	545	495	433	433
query63	244	206	200	200
query64	2827	1037	876	876
query65	4752	4632	4604	4604
query66	1817	512	377	377
query67	29189	29140	29017	29017
query68	2986	1489	1004	1004
query69	402	303	270	270
query70	1081	946	977	946
query71	393	330	334	330
query72	3018	2645	2355	2355
query73	858	771	423	423
query74	5042	4895	4713	4713
query75	2495	2481	2129	2129
query76	2336	1153	778	778
query77	354	374	279	279
query78	11901	11907	11160	11160
query79	1506	1150	792	792
query80	1271	544	457	457
query81	570	339	283	283
query82	617	154	120	120
query83	359	319	309	309
query84	292	158	137	137
query85	960	602	513	513
query86	433	280	273	273
query87	1827	1822	1732	1732
query88	3655	2782	2780	2780
query89	437	378	320	320
query90	1960	204	196	196
query91	206	193	171	171
query92	63	62	55	55
query93	1693	1473	996	996
query94	717	364	309	309
query95	802	518	565	518
query96	1133	777	337	337
query97	2622	2623	2528	2528
query98	218	206	196	196
query99	1090	1112	966	966
Total cold run time: 262890 ms
Total hot run time: 177192 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.09	0.05	0.05
query3	0.25	0.14	0.13
query4	1.62	0.14	0.14
query5	0.24	0.24	0.22
query6	1.23	1.07	1.08
query7	0.04	0.01	0.00
query8	0.06	0.03	0.04
query9	0.38	0.31	0.32
query10	0.56	0.56	0.54
query11	0.20	0.15	0.14
query12	0.18	0.14	0.14
query13	0.47	0.48	0.47
query14	1.03	1.02	1.01
query15	0.63	0.61	0.60
query16	0.32	0.31	0.32
query17	1.17	1.10	1.15
query18	0.22	0.20	0.20
query19	2.10	1.92	1.93
query20	0.02	0.01	0.02
query21	15.43	0.21	0.13
query22	4.85	0.05	0.05
query23	16.13	0.30	0.13
query24	2.90	0.45	0.34
query25	0.10	0.05	0.04
query26	0.73	0.22	0.14
query27	0.04	0.03	0.03
query28	3.54	0.87	0.53
query29	12.47	4.18	3.30
query30	0.30	0.15	0.15
query31	2.77	0.61	0.32
query32	3.22	0.59	0.50
query33	3.16	3.19	3.22
query34	15.61	4.19	3.54
query35	3.51	3.48	3.57
query36	0.56	0.42	0.43
query37	0.09	0.06	0.07
query38	0.05	0.05	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.16
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.68 s
Total hot run time: 25.07 s

@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.

Requesting changes: two P1 correctness blockers remain.

Critical checkpoint conclusions

  • Goal: The patch correctly preserves authoritative Iceberg mapping presence for ordinary same-version ID-less legacy reads, but it does not preserve matching IDs in mixed-ID files and is not semantically stable across the supported rolling-upgrade phases.
  • Scope and minimality: The implementation is otherwise focused on FE transport plus V1/V2 name matching; the two existing review threads for valid root [] presence and nested presence propagation are fixed on the current head.
  • Concurrency: No new threads, shared mutable state, locks, or lock-order concerns are introduced.
  • Lifecycle: No static-initialization, ownership, or special resource-lifecycle behavior changes.
  • Configuration: No configuration item is added or changed.
  • Compatibility: TField.name_mapping remains wire-decodable, but its interpretation changes without version negotiation. Old/new BEs can split one scan during BE-first rollout, and old/new FEs can produce different plans during the following FE rollout (second inline finding).
  • Parallel paths: FE regular/system-table schemas, hidden equality-delete dependencies, V1/V2, Parquet/ORC, whole/pruned complex fields, and position-delete paths were traced. V1 and V2 both globally downgrade mixed-ID schemas and lose an authoritative matching ID (first inline finding).
  • Conditional logic: The new mapping-presence condition is documented and propagated through the changed builders, but the surrounding all-fields-have-IDs condition is too coarse for the strict branch. No other distinct conditional-path issue survived review.
  • Test coverage: Added FE and BE unit tests cover absent, empty, partial, and nested presence/helper state, but miss mixed-ID Parquet/ORC behavior, old-FE/mixed-BE and mixed-FE execution, and the resulting observable value/default behavior.
  • Test results: No regression output file is changed. This review was static-only as required by the task; no local build or test was run.
  • Observability: Existing parse-failure logging is sufficient for the new FE parse path; the accepted failures are silent wrong-result cases that require correctness fixes rather than additional logging.
  • Persistence and transactions: No EditLog, persisted format, transaction, or failover behavior changes.
  • Data writes: This is a read-path change and introduces no write atomicity or crash-recovery concern.
  • FE/BE state transport: All same-version mapping send/copy sites were checked. The existing optional list and new local presence bit are propagated, but the missing semantic version is the rolling-compatibility blocker above.
  • Performance and memory: The metadata boolean and small mapping copies add no material CPU, memory, allocation, or hot-path concern.
  • Other issues, focus, and completion: No additional user focus was supplied. After three normal/risk-focused convergence rounds, every candidate is accepted, deduplicated, or dismissed and all final reviewers returned NO_NEW_VALUABLE_FINDINGS on this exact two-comment set. The full review is complete.

Comment thread be/src/format/table/table_schema_change_helper.cpp Outdated
Comment thread be/src/format_v2/column_mapper.cpp
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (14/14) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.48% (23963/41688)
Line Coverage 41.23% (235862/572027)
Region Coverage 37.02% (186200/502950)
Branch Coverage 38.23% (83647/218786)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (14/14) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.96% (30485/40666)
Line Coverage 59.12% (336086/568508)
Region Coverage 55.85% (281962/504842)
Branch Coverage 57.17% (125155/218928)

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

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.

Requesting changes: three P1 correctness blockers remain.

Critical checkpoint conclusions

  • Goal and tests: The patch moves V1 and V2 toward Iceberg's any-ID rule and preserves explicit mapping presence, but ID-less nested wrappers still diverge by scanner/format, nested binary initial defaults are lost during projection, and an unchanged V2 equality-delete test is deterministically contradicted by the new mode. The added tests primarily assert helper or transport state and do not cover these observable results.
  • Scope and minimality: The implementation is focused on FE mapping extraction/Thrift transport and BE matching. No unrelated production changes were found.
  • Concurrency, lifecycle, configuration, persistence, and writes: No new thread, lock, ownership, startup/shutdown, configuration, persisted-state, transaction, or data-write contract is introduced.
  • Compatibility and protocol: The optional Thrift presence marker is produced and consumed consistently on same-version paths, and absent old-FE state retains legacy behavior. The mixed-version semantic issue remains covered by the existing rolling-upgrade thread and is not duplicated here.
  • Parallel paths: V1/V2, Parquet/ORC, whole/pruned complex projections, schema-history reconstruction, hidden equality-delete dependencies, and both position-delete paths were traced. The position-delete candidate was dismissed because supported Iceberg position-delete schemas require fixed/matching IDs and the metadata-table scan does not transport the claimed authoritative mapping state.
  • Conditional and null/default behavior: V1's per-struct any-ID condition and V2's global current-node matcher do not implement each format's wrapper projection contract. Separately, recursive Base64 initial-default metadata is dropped before a newly missing nested child is materialized.
  • FE/BE transport: Mapping authority and nested Base64 defaults reach BE schema reconstruction. Authority now survives the changed access-path copy, but the nested default value/encoding metadata does not, which causes the second inline failure.
  • Error and nullability handling: No new status-propagation defect survived review. The accepted failures are silent wrong-result/default-materialization cases rather than missing diagnostics.
  • Observability: Existing debug-state additions are adequate; no separate logging or metric concern was found.
  • Performance and memory: Recursive schema scans and one metadata boolean are planning/setup work with negligible cost; no per-row hot-path or allocation regression was found.
  • User focus and completion: No additional user focus was supplied. After the final wording correction, all three reviewers independently returned NO_NEW_VALUABLE_FINDINGS on this exact three-comment set and anchors.
  • Validation: Static review only, because the review task prohibited builds and test execution. At submission, formatting, CheckStyle, license, dependency, secret, and Cloud UT checks pass; BE UT, FE UT, compile, code-review, and performance checks are pending. The macOS BE UT workflow failed during environment setup because it selected JDK 25 while the build requires JDK 17.

The review remains blocking because all three findings can change returned Iceberg row values or leave the checked-in reader test contract inconsistent with the implementation.

Comment thread be/src/format/table/table_schema_change_helper.cpp Outdated
Comment thread be/src/exec/scan/access_path_parser.cpp
Comment thread be/src/format_v2/table/iceberg_reader.h
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17853	4086	4035	4035
q2	2029	335	205	205
q3	10301	1481	843	843
q4	4687	476	358	358
q5	7500	845	574	574
q6	177	170	138	138
q7	744	822	612	612
q8	9323	1656	1699	1656
q9	5714	4417	4353	4353
q10	6741	1735	1492	1492
q11	509	353	330	330
q12	738	587	462	462
q13	18095	3388	2781	2781
q14	271	267	246	246
q15	q16	796	788	705	705
q17	1044	920	1016	920
q18	6966	5781	5499	5499
q19	1306	1310	1183	1183
q20	828	691	553	553
q21	5924	2662	2426	2426
q22	434	361	303	303
Total cold run time: 101980 ms
Total hot run time: 29674 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4432	4369	4303	4303
q2	283	314	216	216
q3	4553	4940	4440	4440
q4	2062	2150	1389	1389
q5	4401	4262	4265	4262
q6	236	176	152	152
q7	1776	2054	1705	1705
q8	2466	2242	2111	2111
q9	7774	7736	7809	7736
q10	4723	4691	4283	4283
q11	590	455	405	405
q12	897	814	536	536
q13	3219	3556	3018	3018
q14	291	307	278	278
q15	q16	713	751	659	659
q17	1376	1389	1332	1332
q18	8125	7474	6987	6987
q19	1112	1053	1075	1053
q20	2236	2222	1927	1927
q21	5277	4674	4485	4485
q22	514	453	407	407
Total cold run time: 57056 ms
Total hot run time: 51684 ms

@hello-stephen

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

query5	4331	620	475	475
query6	466	227	198	198
query7	4933	615	341	341
query8	350	192	170	170
query9	8787	4068	4015	4015
query10	482	364	319	319
query11	5924	2362	2085	2085
query12	163	106	105	105
query13	1301	623	437	437
query14	6251	5185	4871	4871
query14_1	4251	4212	4266	4212
query15	222	204	185	185
query16	1053	490	451	451
query17	1145	705	576	576
query18	2502	480	355	355
query19	212	197	163	163
query20	114	114	106	106
query21	236	164	139	139
query22	13510	13537	13287	13287
query23	17295	16503	16132	16132
query23_1	16287	16266	16286	16266
query24	7675	1791	1246	1246
query24_1	1336	1298	1275	1275
query25	581	472	398	398
query26	1355	344	224	224
query27	2589	613	390	390
query28	4471	1989	2032	1989
query29	1123	645	520	520
query30	344	271	226	226
query31	1115	1093	980	980
query32	111	65	61	61
query33	539	328	272	272
query34	1182	1136	644	644
query35	781	790	671	671
query36	1202	1237	1082	1082
query37	155	109	99	99
query38	1880	1702	1670	1670
query39	879	887	866	866
query39_1	853	832	836	832
query40	287	163	140	140
query41	65	62	64	62
query42	99	89	90	89
query43	318	320	282	282
query44	1402	761	747	747
query45	194	183	176	176
query46	1100	1172	731	731
query47	2172	2145	2084	2084
query48	397	384	291	291
query49	576	423	316	316
query50	1048	460	333	333
query51	11068	11102	10853	10853
query52	87	83	78	78
query53	265	277	203	203
query54	274	234	229	229
query55	78	71	66	66
query56	292	305	298	298
query57	1321	1289	1201	1201
query58	296	273	254	254
query59	1571	1664	1471	1471
query60	306	268	254	254
query61	157	155	150	150
query62	547	494	440	440
query63	252	208	197	197
query64	2850	1071	912	912
query65	4697	4632	4624	4624
query66	1812	518	377	377
query67	29282	29166	29027	29027
query68	3089	1630	942	942
query69	412	305	258	258
query70	1082	966	936	936
query71	364	331	327	327
query72	3113	2712	2407	2407
query73	805	736	440	440
query74	5080	4896	4698	4698
query75	2546	2498	2133	2133
query76	2377	1197	797	797
query77	347	381	280	280
query78	11944	12055	11207	11207
query79	1527	1162	782	782
query80	1294	566	468	468
query81	576	329	291	291
query82	598	155	119	119
query83	371	325	295	295
query84	293	162	133	133
query85	980	622	519	519
query86	427	297	294	294
query87	1810	1822	1755	1755
query88	3711	2851	2771	2771
query89	441	378	332	332
query90	1895	208	197	197
query91	203	191	166	166
query92	61	59	58	58
query93	1755	1565	965	965
query94	719	369	309	309
query95	799	610	481	481
query96	1005	782	334	334
query97	2623	2644	2499	2499
query98	219	207	195	195
query99	1093	1103	980	980
Total cold run time: 264695 ms
Total hot run time: 177702 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.14	0.08	0.08
query3	0.40	0.25	0.24
query4	1.61	0.23	0.24
query5	0.34	0.32	0.32
query6	1.15	0.67	0.67
query7	0.03	0.01	0.01
query8	0.09	0.07	0.07
query9	0.52	0.39	0.39
query10	0.61	0.60	0.60
query11	0.31	0.18	0.19
query12	0.32	0.19	0.19
query13	0.53	0.54	0.53
query14	0.95	0.94	0.93
query15	0.67	0.59	0.60
query16	0.39	0.39	0.40
query17	1.03	1.03	1.16
query18	0.32	0.31	0.30
query19	1.91	1.86	1.80
query20	0.02	0.02	0.01
query21	15.40	0.36	0.32
query22	4.94	0.14	0.14
query23	15.84	0.49	0.30
query24	2.48	0.61	0.44
query25	0.16	0.10	0.10
query26	0.74	0.27	0.22
query27	0.10	0.10	0.10
query28	3.46	0.96	0.51
query29	12.50	4.26	3.34
query30	0.37	0.27	0.26
query31	2.76	0.61	0.32
query32	3.23	0.60	0.48
query33	2.98	2.93	2.90
query34	15.68	4.13	3.39
query35	3.33	3.30	3.24
query36	0.65	0.53	0.50
query37	0.12	0.09	0.10
query38	0.08	0.06	0.07
query39	0.08	0.06	0.06
query40	0.20	0.19	0.18
query41	0.13	0.08	0.08
query42	0.08	0.06	0.06
query43	0.08	0.07	0.07
Total cold run time: 96.74 s
Total hot run time: 25.72 s

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

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.

Requesting changes: five P1 correctness blockers remain.

Critical checkpoint conclusions

  • Goal and tests: The patch advances strict partial Iceberg name mappings, but it still returns wrong values for recursive ID-less Parquet wrappers, nested non-binary defaults, projected binary defaults, and schema-only binary additions; long VARBINARY defaults also have a use-after-free. The added unit tests do not prove these observable paths.
  • Scope and minimality: The production changes are focused on FE schema transport and V1/V2 projection/default materialization. No unrelated production change was found.
  • Concurrency and lifecycle: No new threads, shared mutable state, locks, lock-order, static-initialization, or service lifecycle behavior is introduced. Memory ownership is blocking, however: decoded VARBINARY data is retained through a borrowed StringView after its backing string is destroyed.
  • Configuration, persistence, transactions, and writes: No configuration, EditLog, persisted storage format, transaction, failover, or data-write contract changes. This is a read-path change.
  • Compatibility and FE/BE transport: The optional Thrift authority marker preserves old-FE fallback and is wire-compatible for BE-first rollout. Same-version default transport is incomplete: nested non-binary values are never serialized, ordinary scans can select an older schema for binary metadata, and projected roots discard correctly transported binary metadata.
  • Parallel paths and conditionals: V1/V2, Parquet/ORC, whole/pruned complex projections, current/time-travel scans, and hidden equality-delete dependencies were traced. The Parquet ID-less-wrapper exception is applied only at the root; the recursive matcher remains strict. A separate V1 global-any-ID residual is real but already covered by r3609339720 and was not duplicated.
  • Error and nullability handling: Invalid Base64 statuses are propagated and the new checks are invariant-oriented. The accepted failures instead silently materialize NULL/type-default/Base64 text or read freed storage, so logging cannot make them safe.
  • Tests and validation: Existing additions cover mapping presence, a root ID-less wrapper, and four-byte DataTypeString defaults. Missing coverage includes a second-level wrapper, nested INT/STRING/DATE defaults, projected top-level BINARY/FIXED/UUID results, a schema-only binary addition after the last data snapshot, and 16-byte VARBINARY ownership under ASan. Static review only; the task explicitly prohibited builds and test execution.
  • Performance and observability: The new schema-time recursion and metadata fields have negligible setup cost, and debug output covers mapping state. No material hot-path or observability issue survived review.
  • User focus and completion: No additional user focus was supplied. After Round 2, both independent full reviewers and the risk-focused reviewer returned NO_NEW_VALUABLE_FINDINGS on this exact five-comment set and anchors. The review is complete.

All five findings can change returned Iceberg values; the ownership defect can additionally crash or trip ASan.

Comment thread be/src/format_v2/column_mapper.cpp
Comment thread be/src/format_v2/table_reader.cpp
Comment thread be/src/format_v2/column_mapper.cpp
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 70.37% (19/27) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17726	4238	4253	4238
q2	1997	336	214	214
q3	10299	1525	835	835
q4	4744	497	345	345
q5	7829	911	588	588
q6	235	184	146	146
q7	767	838	612	612
q8	10255	1632	1656	1632
q9	5873	4327	4349	4327
q10	6806	1780	1471	1471
q11	520	352	343	343
q12	755	584	477	477
q13	18091	3499	2709	2709
q14	279	264	259	259
q15	q16	781	778	711	711
q17	1029	1061	997	997
q18	6966	5782	5569	5569
q19	1666	1318	1085	1085
q20	807	717	629	629
q21	5653	2605	2537	2537
q22	443	367	313	313
Total cold run time: 103521 ms
Total hot run time: 30037 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4639	4492	4481	4481
q2	293	323	226	226
q3	4627	4988	4402	4402
q4	2232	2268	1467	1467
q5	4550	4375	4762	4375
q6	280	209	168	168
q7	2202	1800	1693	1693
q8	2694	2485	2313	2313
q9	8239	7837	7785	7785
q10	4758	4712	4253	4253
q11	612	470	433	433
q12	778	795	574	574
q13	3300	3690	2917	2917
q14	306	311	293	293
q15	q16	729	734	659	659
q17	1433	1403	1562	1403
q18	8107	7817	7575	7575
q19	1162	1060	1061	1060
q20	2228	2223	1936	1936
q21	5473	4827	4648	4648
q22	549	475	419	419
Total cold run time: 59191 ms
Total hot run time: 53080 ms

@hello-stephen

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

query5	4314	615	467	467
query6	453	236	223	223
query7	4839	566	311	311
query8	336	183	178	178
query9	8757	4048	4053	4048
query10	472	369	291	291
query11	5900	2312	2182	2182
query12	161	105	99	99
query13	1262	582	434	434
query14	6244	5173	4884	4884
query14_1	4227	4204	4388	4204
query15	209	205	185	185
query16	1010	485	453	453
query17	1127	726	578	578
query18	2473	498	372	372
query19	198	193	143	143
query20	114	106	105	105
query21	229	156	136	136
query22	13632	13651	13296	13296
query23	17464	16428	16107	16107
query23_1	16237	16241	16165	16165
query24	7483	1750	1268	1268
query24_1	1268	1273	1250	1250
query25	553	430	356	356
query26	1319	365	209	209
query27	2601	573	388	388
query28	4467	1998	1972	1972
query29	1063	604	464	464
query30	344	275	227	227
query31	1109	1086	974	974
query32	114	64	59	59
query33	516	330	245	245
query34	1149	1186	635	635
query35	760	775	683	683
query36	1180	1168	1050	1050
query37	159	106	93	93
query38	1880	1710	1660	1660
query39	873	878	841	841
query39_1	844	856	828	828
query40	249	164	142	142
query41	65	65	62	62
query42	95	92	91	91
query43	325	321	281	281
query44	1426	745	743	743
query45	246	187	174	174
query46	1104	1200	735	735
query47	2150	2053	1920	1920
query48	397	397	280	280
query49	586	411	319	319
query50	1094	426	337	337
query51	10822	10967	10956	10956
query52	85	93	76	76
query53	253	278	201	201
query54	278	233	214	214
query55	73	70	66	66
query56	294	299	295	295
query57	1331	1284	1182	1182
query58	275	264	259	259
query59	1589	1601	1412	1412
query60	319	268	259	259
query61	155	150	148	148
query62	565	497	427	427
query63	234	195	200	195
query64	2834	1008	873	873
query65	4723	4623	4664	4623
query66	1805	510	372	372
query67	29314	29266	29131	29131
query68	3049	1514	1044	1044
query69	393	296	262	262
query70	1062	977	960	960
query71	365	343	317	317
query72	3087	2689	2367	2367
query73	903	810	429	429
query74	5083	4890	4734	4734
query75	2543	2523	2129	2129
query76	2333	1129	754	754
query77	351	384	264	264
query78	11976	11860	11367	11367
query79	1230	1140	751	751
query80	611	543	459	459
query81	447	335	286	286
query82	233	163	120	120
query83	318	319	299	299
query84	282	161	127	127
query85	906	599	532	532
query86	329	286	270	270
query87	1823	1813	1748	1748
query88	3701	2755	2750	2750
query89	419	366	350	350
query90	2212	213	205	205
query91	226	212	178	178
query92	67	61	57	57
query93	1617	1552	1017	1017
query94	546	358	326	326
query95	812	627	486	486
query96	1026	784	346	346
query97	2640	2622	2505	2505
query98	215	213	207	207
query99	1093	1121	973	973
Total cold run time: 262265 ms
Total hot run time: 177659 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.25	0.14	0.14
query4	1.61	0.14	0.15
query5	0.24	0.26	0.23
query6	1.25	1.09	1.08
query7	0.03	0.00	0.00
query8	0.06	0.04	0.04
query9	0.41	0.34	0.33
query10	0.57	0.57	0.59
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.48	0.48	0.47
query14	1.04	1.01	1.00
query15	0.63	0.63	0.60
query16	0.31	0.33	0.31
query17	1.11	1.20	1.09
query18	0.23	0.22	0.22
query19	2.08	1.98	1.94
query20	0.02	0.01	0.02
query21	15.43	0.21	0.14
query22	4.96	0.05	0.06
query23	16.14	0.30	0.13
query24	2.97	0.43	0.31
query25	0.12	0.05	0.04
query26	0.73	0.21	0.14
query27	0.05	0.04	0.03
query28	3.54	0.90	0.54
query29	12.49	4.13	3.29
query30	0.27	0.14	0.14
query31	2.77	0.59	0.32
query32	3.22	0.60	0.49
query33	3.31	3.28	3.32
query34	15.71	4.29	3.57
query35	3.56	3.52	3.51
query36	0.57	0.46	0.47
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.17	0.16
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.15 s
Total hot run time: 25.33 s

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17656	4086	4062	4062
q2	2008	333	212	212
q3	10259	1491	836	836
q4	4685	479	348	348
q5	7517	865	583	583
q6	187	179	141	141
q7	800	830	619	619
q8	9394	1583	1522	1522
q9	5547	4408	4414	4408
q10	6780	1747	1507	1507
q11	511	359	328	328
q12	731	604	472	472
q13	18098	3357	2761	2761
q14	269	274	246	246
q15	q16	792	791	710	710
q17	999	970	966	966
q18	6885	5825	5659	5659
q19	1176	1229	1160	1160
q20	796	668	610	610
q21	5585	2741	2466	2466
q22	439	359	300	300
Total cold run time: 101114 ms
Total hot run time: 29916 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4444	4327	4316	4316
q2	295	338	218	218
q3	4569	4996	4408	4408
q4	2085	2186	1400	1400
q5	4419	4263	4344	4263
q6	228	174	129	129
q7	1793	1982	1937	1937
q8	2689	2284	2270	2270
q9	8172	8284	7808	7808
q10	4686	4654	4210	4210
q11	569	440	398	398
q12	804	771	562	562
q13	3372	3605	3044	3044
q14	293	301	288	288
q15	q16	722	737	647	647
q17	1378	1389	1363	1363
q18	8194	7451	7545	7451
q19	1195	1093	1115	1093
q20	2231	2203	1944	1944
q21	5358	4643	4626	4626
q22	516	498	420	420
Total cold run time: 58012 ms
Total hot run time: 52795 ms

@hello-stephen

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

query5	4343	625	504	504
query6	460	245	213	213
query7	4830	624	350	350
query8	340	193	186	186
query9	8780	4055	4088	4055
query10	469	396	304	304
query11	5897	2327	2140	2140
query12	165	105	104	104
query13	1292	621	438	438
query14	6255	5216	4890	4890
query14_1	4265	4191	4578	4191
query15	214	210	175	175
query16	1028	501	438	438
query17	1131	671	561	561
query18	2447	469	339	339
query19	213	190	141	141
query20	110	106	105	105
query21	235	159	137	137
query22	13548	13615	13299	13299
query23	17450	16519	16053	16053
query23_1	16206	16141	16265	16141
query24	7476	1760	1284	1284
query24_1	1291	1314	1294	1294
query25	543	434	363	363
query26	1342	365	205	205
query27	2605	597	380	380
query28	4464	1992	1986	1986
query29	1058	615	501	501
query30	342	270	235	235
query31	1121	1105	985	985
query32	115	72	62	62
query33	528	334	272	272
query34	1193	1126	659	659
query35	776	767	664	664
query36	1193	1198	1049	1049
query37	163	112	94	94
query38	1890	1705	1647	1647
query39	875	869	854	854
query39_1	838	834	836	834
query40	253	170	150	150
query41	89	71	70	70
query42	96	95	94	94
query43	331	343	289	289
query44	1446	789	774	774
query45	202	185	186	185
query46	1113	1172	749	749
query47	2201	2152	2039	2039
query48	389	415	304	304
query49	586	421	354	354
query50	1079	416	348	348
query51	11030	11052	10821	10821
query52	92	88	78	78
query53	265	285	211	211
query54	305	249	235	235
query55	79	78	68	68
query56	353	314	290	290
query57	1354	1297	1220	1220
query58	304	261	270	261
query59	1593	1658	1487	1487
query60	309	278	265	265
query61	157	145	150	145
query62	543	500	431	431
query63	250	205	205	205
query64	2834	1084	863	863
query65	4735	4653	4642	4642
query66	1837	511	384	384
query67	29245	29211	28993	28993
query68	3253	1550	1000	1000
query69	392	290	263	263
query70	1042	1017	956	956
query71	377	336	322	322
query72	3052	2732	2545	2545
query73	850	765	418	418
query74	5073	4931	4745	4745
query75	2538	2525	2133	2133
query76	2336	1186	790	790
query77	355	377	289	289
query78	11746	11910	11303	11303
query79	1365	1129	736	736
query80	738	557	475	475
query81	467	340	295	295
query82	561	157	120	120
query83	408	323	312	312
query84	284	155	134	134
query85	970	621	542	542
query86	374	299	277	277
query87	1831	1819	1749	1749
query88	3739	2794	2764	2764
query89	426	369	341	341
query90	1815	202	202	202
query91	212	197	159	159
query92	66	59	59	59
query93	1580	1574	1068	1068
query94	632	368	306	306
query95	792	586	476	476
query96	1064	855	379	379
query97	2633	2617	2493	2493
query98	216	219	208	208
query99	1115	1123	978	978
Total cold run time: 263021 ms
Total hot run time: 178313 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.14	0.08	0.09
query3	0.37	0.25	0.24
query4	1.61	0.26	0.25
query5	0.33	0.31	0.32
query6	1.16	0.67	0.67
query7	0.03	0.01	0.00
query8	0.09	0.08	0.08
query9	0.50	0.38	0.38
query10	0.59	0.59	0.60
query11	0.31	0.19	0.18
query12	0.30	0.19	0.18
query13	0.53	0.54	0.52
query14	0.93	0.92	0.91
query15	0.68	0.60	0.60
query16	0.38	0.38	0.40
query17	1.02	1.00	0.99
query18	0.31	0.30	0.30
query19	1.95	1.75	1.75
query20	0.02	0.02	0.01
query21	15.39	0.37	0.33
query22	4.86	0.16	0.13
query23	15.83	0.52	0.30
query24	2.49	0.61	0.42
query25	0.15	0.11	0.10
query26	0.74	0.27	0.22
query27	0.11	0.10	0.10
query28	3.44	0.92	0.52
query29	12.48	4.26	3.34
query30	0.37	0.27	0.26
query31	2.77	0.63	0.32
query32	3.23	0.61	0.47
query33	3.04	2.99	2.97
query34	15.69	4.05	3.37
query35	3.28	3.28	3.30
query36	0.65	0.54	0.51
query37	0.14	0.10	0.10
query38	0.08	0.07	0.07
query39	0.07	0.06	0.06
query40	0.20	0.18	0.17
query41	0.13	0.08	0.08
query42	0.09	0.06	0.06
query43	0.08	0.07	0.08
Total cold run time: 96.57 s
Total hot run time: 25.68 s

@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.

Request changes: three wrong-result gaps remain in the Iceberg legacy-schema compatibility work.

Findings:

  • P1: an ordinary scan can combine statement-pinned S1 columns with binary-default markers from a cache-reloaded S2 table and return Base64 carrier text for an S1 STRING/CHAR-mapped binary field.
  • P1: a valid authoritative [] name mapping prevents both scanners from retaining an ID-less Parquet wrapper even when a selected descendant field ID proves the wrapper is physical.
  • P1: V1 loses that same kind of wrapper when an unrelated direct root has an ID, while V2 returns the physical descendant.

Critical checkpoint conclusions:

  • Goal and proof: The PR correctly improves absent-versus-present mapping transport, recursive initial defaults, and several V1/V2 parity cases, but the three cases above show that the stated legacy-file correctness goal is not complete. Existing tests cover the ingredients separately, not these cross-products.
  • Scope and clarity: The broad FE/Thrift/V1/V2/test scope is justified by the compatibility boundary and is otherwise focused. The remaining defects are localized to schema-source selection and Parquet wrapper matching.
  • Concurrency: No new threads, locks, atomics, or lock-order risks were introduced. The relevant concurrent operation is external schema evolution plus metadata-cache invalidation during planning; the statement snapshot and later scan-node table generation can diverge as described in the first finding.
  • Lifecycle: No static-initialization or resource-cycle issue was found. The non-intuitive lifetime is the statement-pinned schema ID versus the independently invalidatable Iceberg Table object, which causes the first finding.
  • Configuration: No configuration item is added. The first wrong-result path applies when Iceberg binary logical types are mapped to Doris STRING/CHAR; VARBINARY mapping independently infers Base64 and is not affected by that specific decode symptom.
  • Compatibility: Optional Thrift field 9 preserves old-plan decoding and supports the documented BE-first rollout. The already-raised mixed-FE semantic difference is not duplicated here; all three findings are reachable in a compatible new-FE/new-BE deployment.
  • Parallel paths and conditions: I traced FE serialization through both scanners, Parquet versus ORC, top-level and recursive struct/array/map paths, access pruning, and equality-delete hidden keys. ORC intentionally excludes retained ID-less wrappers; the two wrapper findings are Parquet-specific omissions.
  • Tests and results: Added unit tests and expected results are internally consistent, but they miss cache invalidation between MVCC capture and marker serialization, authoritative-empty mapping plus a retained wrapper, and the V1 unrelated-direct-ID wrapper result. No generated regression result changed.
  • Observability and error handling: No new metric is required for schema-time mapping. New decode/parse statuses are checked and propagated; the reviewed paths do not silently discard errors.
  • Transactions, persistence, and writes: No Doris EditLog, transaction, persistence, storage-format write, visible-version, or MoW path is changed.
  • FE-BE variables: Mapping authority and recursive default/Base64 metadata are transported through the intended paths. The second finding is a BE consumption-order error after correct transport, not a missing wire field.
  • Memory and nullable safety: Temporary variable-width defaults are copied into owning columns or literals before buffers expire; const/nullable materialization and repeated-batch row counts are consistent. No additional ownership defect was found.
  • Performance: New work is schema/scan initialization work rather than per-row matching; no substantiated blocking CPU or memory regression was found.
  • Other issues: No additional configuration, cleanup, data-correctness, observability, or test-result defect remained after the final whole-diff sweep. The user supplied no extra review focus.

Validation: Static review only, as required by the automated-review contract; I did not run local builds or tests. At finalization, compile, Cloud UT, style, license, secret, and dependency checks pass; macOS BE UT fails before the build because CI provides JDK 25 while the job requires JDK 17; the two coverage checks report zero-duration TeamCity failures; BE/FE UT and regression/performance jobs are still pending.

Review completion: Reviewed the unchanged head 3050fa2a2caedb13d7308fa74be4f06d4a42941e, all 27 changed files, required design/agent guidance, and all prior threads. Three independent reviewers performed normal and risk-focused convergence; every suspicious point is accepted above, dismissed with evidence, or deduplicated against an existing thread.

Comment thread be/src/format_v2/column_mapper.cpp Outdated
Comment thread be/src/format/table/table_schema_change_helper.cpp Outdated
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 79.49% (31/39) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 73.45% (260/354) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.45% (23962/41707)
Line Coverage 41.20% (235794/572302)
Region Coverage 37.01% (186242/503241)
Branch Coverage 38.23% (83713/218970)

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17596	4207	4101	4101
q2	2011	319	202	202
q3	10353	1442	813	813
q4	4684	472	336	336
q5	7503	839	574	574
q6	183	177	139	139
q7	752	834	619	619
q8	9328	1481	1611	1481
q9	6053	4372	4349	4349
q10	6738	1730	1450	1450
q11	508	351	319	319
q12	715	573	453	453
q13	18147	3390	2751	2751
q14	262	266	247	247
q15	q16	794	771	705	705
q17	976	1007	994	994
q18	7313	5773	5521	5521
q19	1828	1374	1006	1006
q20	833	698	589	589
q21	5822	2567	2419	2419
q22	430	356	298	298
Total cold run time: 102829 ms
Total hot run time: 29366 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4524	4461	4414	4414
q2	283	316	211	211
q3	4568	4999	4396	4396
q4	2087	2167	1364	1364
q5	4385	4282	4287	4282
q6	233	177	130	130
q7	1950	2099	1862	1862
q8	2524	2186	2179	2179
q9	8264	8071	7932	7932
q10	4701	4671	4240	4240
q11	577	457	390	390
q12	756	782	550	550
q13	3386	3524	2946	2946
q14	306	318	267	267
q15	q16	716	739	652	652
q17	1415	1348	1365	1348
q18	8135	7581	7248	7248
q19	1183	1071	1067	1067
q20	2201	2213	1953	1953
q21	5270	4560	4446	4446
q22	517	445	437	437
Total cold run time: 57981 ms
Total hot run time: 52314 ms

@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 summary

Requesting changes for two P1 correctness gaps:

  • Statement-pinned Iceberg Columns can be combined with a refreshed name-mapping property, making a valid refreshed [] unexpectedly authoritative for an already-bound statement and returning default/NULL instead of an ID-less same-name file value.
  • V1 Parquet can leave whole-file field-ID mode inside an already ID-matched struct and alias-bind an ID-less primitive child that Iceberg projection and V2 treat as missing.

No additional user-provided review focus was supplied.

Critical-checkpoint conclusions

  • Goal and proof: The PR aims to make partial/present-empty name mappings authoritative and align V1/V2 missing-field defaults. It does not fully accomplish that goal because of the two blockers above. The new tests prove many intended branches but omit both exact reproductions.
  • Scope: The production and test changes are related to the same FE-to-reader schema contract. The follow-up fixes are broad but cohesive; no unrelated source change was identified.
  • Concurrency: No new threads or BE locking are introduced. The relevant concurrent lifecycle is FE statement binding versus external metadata-cache invalidation/property refresh, and M1 violates that statement boundary.
  • Lifecycle/static initialization: Reader-owned columns/literals have bounded lifetimes and the changed variable-width default carriers are owned correctly. No static-initialization or release-order issue was found; the lazy Table versus statement snapshot lifetime is the M1 blocker.
  • Configuration: No configuration item is added or changed.
  • Compatibility: The optional Thrift authority bit preserves old-FE/new-BE fallback and is ignored by old BEs; no storage-format or symbol incompatibility was found. The already-raised mixed-rollout concern was not duplicated.
  • Parallel paths: FE serialization, V1 Parquet/ORC, V2 Parquet/ORC, nested struct/array/map projection, equality deletes, position deletes, virtual columns, and access-path pruning were checked. M2 remains only in V1 Parquet; the analogous ORC recursion includes the matched parent ID.
  • Conditional checks: Present-empty mapping authority, existential any-ID selection, and Parquet's unique complex-wrapper exception were traced. M2 incorrectly recomputes the any-ID condition at a nested struct.
  • Test coverage: Tests cover absent/present-empty/partial mappings, mixed IDs, wrapper retention, nested/default metadata, binary ownership, and ordinary equality-delete defaults. They lack the property-refresh race and the ID-matched-parent/all-ID-less-child V1 reader result.
  • Test-result changes: No regression .out file is changed. Static inspection found the modified unit expectations consistent with the cases they cover.
  • Observability: No new metric or high-volume log is needed for these plan/setup paths; existing status/error propagation is adequate for the changed decoding paths.
  • Transactions/persistence: No Doris transaction, EditLog, or persisted-state path is modified.
  • Data writes: The PR changes read planning/materialization only; no write atomicity or crash-recovery path applies.
  • FE-BE variables: The new authority marker and initial-default metadata are serialized and copied through root and nested paths. The missing piece is pinning mapping property presence/content to the FE statement generation.
  • Performance: Added work is schema/setup traversal rather than per-row processing; no material CPU or memory regression was found.
  • Other issues: Error handling, nullable/const materialization, Base64 ownership, delete paths, and duplicate coverage were reviewed. A dropped equality-delete-key limitation was identified but excluded because the aggregate diff does not introduce or worsen it.

Validation was static only, as required by the review contract; no local build or test command was run. At submission time COMPILE, CheckStyle, both Clang Formatter checks, Cloud UT, and vault_p0 pass. FE UT fails, but its TeamCity log requires authorization from this runner; macOS BE UT fails before compilation because that runner supplied JDK 25 while the job requires JDK 17. BE UT and several regression/performance jobs remain pending.

Comment thread be/src/format/table/table_schema_change_helper.cpp Outdated
@hello-stephen

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

query5	4323	640	494	494
query6	461	240	216	216
query7	4843	609	360	360
query8	346	190	169	169
query9	8761	4175	4090	4090
query10	467	368	299	299
query11	5914	2375	2138	2138
query12	160	105	100	100
query13	1271	613	436	436
query14	6175	5214	4908	4908
query14_1	4258	4199	4290	4199
query15	212	211	178	178
query16	1040	539	501	501
query17	1145	716	592	592
query18	2540	493	364	364
query19	214	196	156	156
query20	114	112	107	107
query21	244	159	138	138
query22	13662	13565	13261	13261
query23	17337	16569	16209	16209
query23_1	16281	16275	16216	16216
query24	7542	1770	1283	1283
query24_1	1316	1283	1300	1283
query25	563	474	394	394
query26	1330	360	224	224
query27	2585	583	382	382
query28	4468	1989	1972	1972
query29	1102	653	520	520
query30	343	265	240	240
query31	1117	1110	982	982
query32	115	65	62	62
query33	536	326	255	255
query34	1194	1134	653	653
query35	753	782	673	673
query36	1190	1226	1081	1081
query37	159	112	95	95
query38	1901	1722	1653	1653
query39	877	865	888	865
query39_1	830	833	840	833
query40	251	167	135	135
query41	65	80	66	66
query42	99	89	89	89
query43	319	329	281	281
query44	1406	778	744	744
query45	192	183	174	174
query46	1053	1205	737	737
query47	2142	2129	2008	2008
query48	411	419	303	303
query49	573	417	307	307
query50	1077	440	351	351
query51	11041	10873	10917	10873
query52	86	88	73	73
query53	268	276	196	196
query54	279	242	235	235
query55	75	77	74	74
query56	304	310	317	310
query57	1286	1292	1213	1213
query58	272	265	268	265
query59	1588	1664	1468	1468
query60	300	283	276	276
query61	154	155	177	155
query62	537	496	431	431
query63	243	202	201	201
query64	2845	1046	888	888
query65	4720	4664	4597	4597
query66	1791	504	422	422
query67	29224	29224	29019	29019
query68	3341	1550	986	986
query69	420	314	267	267
query70	1046	975	956	956
query71	389	337	329	329
query72	3020	2667	2388	2388
query73	816	803	418	418
query74	5028	4903	4709	4709
query75	2529	2512	2148	2148
query76	2330	1162	748	748
query77	367	375	288	288
query78	11881	11883	11318	11318
query79	1438	1181	752	752
query80	1278	552	486	486
query81	521	327	292	292
query82	569	152	119	119
query83	399	347	301	301
query84	287	175	133	133
query85	998	617	518	518
query86	413	297	286	286
query87	1827	1826	1776	1776
query88	3676	2806	2762	2762
query89	430	380	334	334
query90	1972	200	199	199
query91	202	193	159	159
query92	62	59	59	59
query93	1613	1518	960	960
query94	758	343	308	308
query95	798	587	481	481
query96	985	800	342	342
query97	2622	2599	2501	2501
query98	215	208	208	208
query99	1085	1119	981	981
Total cold run time: 263936 ms
Total hot run time: 177941 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.10	0.05	0.05
query3	0.25	0.14	0.14
query4	1.61	0.15	0.14
query5	0.25	0.23	0.23
query6	1.24	1.09	1.07
query7	0.04	0.01	0.01
query8	0.05	0.04	0.03
query9	0.37	0.30	0.32
query10	0.59	0.54	0.60
query11	0.19	0.13	0.13
query12	0.18	0.15	0.14
query13	0.48	0.47	0.47
query14	1.02	1.01	0.98
query15	0.60	0.60	0.59
query16	0.32	0.31	0.32
query17	1.09	1.13	1.16
query18	0.26	0.24	0.22
query19	1.95	1.96	1.99
query20	0.01	0.01	0.01
query21	15.37	0.20	0.14
query22	4.95	0.05	0.05
query23	16.14	0.31	0.13
query24	2.91	0.44	0.33
query25	0.11	0.04	0.03
query26	0.72	0.21	0.16
query27	0.05	0.03	0.03
query28	3.52	0.91	0.54
query29	12.50	4.14	3.31
query30	0.27	0.16	0.15
query31	2.78	0.59	0.32
query32	3.22	0.60	0.48
query33	3.16	3.28	3.19
query34	15.65	4.29	3.52
query35	3.48	3.49	3.50
query36	0.55	0.44	0.42
query37	0.10	0.07	0.07
query38	0.06	0.03	0.03
query39	0.04	0.03	0.03
query40	0.18	0.17	0.16
query41	0.09	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.04
Total cold run time: 96.52 s
Total hot run time: 25.11 s

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants