Skip to content

[fix](be) Fix Iceberg row-level deletes across schema evolution#65502

Merged
Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:codex/fix-v2-iceberg-delete-handling
Jul 14, 2026
Merged

[fix](be) Fix Iceberg row-level deletes across schema evolution#65502
Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:codex/fix-v2-iceberg-delete-handling

Conversation

@Gabriel39

@Gabriel39 Gabriel39 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Iceberg row-level delete handling had correctness and efficiency gaps across the V1 and V2 file scanners:

  • FileScannerV2 applied delete expressions with ordinary predicate polarity, keeping rows whose delete predicate evaluated to true instead of removing them.
  • Equality-delete keys could not be resolved when they were hidden from the query projection, renamed through Iceberg name mapping, absent from files written with older schemas, or stored in files without physical field ids.
  • Missing equality keys were rejected instead of being materialized with their Iceberg initial default, or NULL when no initial default exists.
  • Binary-like initial defaults could lose bytes in string transport, timestamp defaults could be parsed with the wrong mapping, and time-travel scans could use metadata from the latest schema instead of the selected snapshot schema.
  • Equality and position delete files shared by multiple data splits were reparsed for every split, and position bounds were not applied.
  • Complex-column rematerialization could trust an incomplete nested descriptor and produce a child type whose nullability disagreed with its parent Struct type. Applying that correction to Array/Map wrapper children could also trigger a fatal child-name mismatch.

This change:

  • Builds an explicit keep filter by inverting delete matches and combines multiple delete files with the correct union semantics.
  • Sends complete Iceberg schema metadata from FE to BE, including historical name mapping and losslessly encoded initial defaults from the selected snapshot schema.
  • Resolves equality keys consistently by field id or BY_NAME mapping in both V1 and V2 scanners, and materializes missing keys with their typed initial default or NULL.
  • Supports all-literal equality predicates by materializing constant keys to the current batch size.
  • Propagates TIMESTAMPTZ mapping to delete-file readers.
  • Caches parsed equality and position delete data in SplitReadOptions.cache, with filesystem, path, and equality-field layout in the cache identity, and applies inclusive position bounds.
  • Uses the parent Struct type as the authoritative contract for child nullability while preserving Array and Map wrapper semantics.

Release note

Fix Iceberg equality and position deletes across schema evolution, including missing and renamed equality keys, initial defaults, historical files without field ids, and delete-file reuse across splits.

Check List (For Author)

  • Test: Unit Test / Regression test
    • 17 focused BE ASAN tests covering Iceberg readers, equality-delete handling, nullable renamed structs, and rebase compatibility
    • 5 existing complex projection and materialization BE ASAN tests
    • 175 ColumnMapper and TableReader BE ASAN tests
    • 17 Iceberg DDL/DML planning FE tests
    • 29 FE tests in ExternalUtilTest, IcebergUtilsTest, and IcebergScanNodeTest
    • Added V2 differential coverage to the Iceberg equality-delete schema-evolution regression suite; the remote external Iceberg suite is disabled in the verification environment
    • Targeted clang-format 16 check
  • Behavior changed: Yes, Iceberg V1 and V2 scans now apply equality and position deletes using the correct schema, default values, predicate polarity, and cached delete data
  • 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 Gabriel39 marked this pull request as ready for review July 12, 2026 12:35
@Gabriel39 Gabriel39 requested a review from yiguolei as a code owner July 12, 2026 12:35
@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

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

Automated review completed after two rounds: main risk scan, normal coverage subagents, risk-focused subagents, and a convergence round all ended with the final M1-M5 set and NO_NEW_VALUABLE_FINDINGS after that set stabilized. I found five issues that should be fixed before merge.

Checkpoint conclusions:

  • Scope/user focus: Reviewed the authoritative diff for the changed Iceberg V2 delete, reader, and test paths. No additional user-provided focus was supplied.
  • Correctness/schema compatibility: Issues found in equality-delete row sizing and BY_NAME schema-evolution binding.
  • Lifecycle/cache: Issue found in shared delete-file cache scoping across split filesystem identities.
  • Tests: Added tests cover useful positive paths but miss the accepted edge cases, and one regression leaks session state on failure.
  • Validation: Static review only; per the review prompt I did not build, run tests, or modify source. .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc are absent in this checkout.

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

Automated review completed after two rounds: main risk scan, normal coverage subagents, risk-focused subagents, and a convergence round all ended with the final M1-M5 set and NO_NEW_VALUABLE_FINDINGS after that set stabilized. I found five issues that should be fixed before merge.

Checkpoint conclusions:

  • Scope/user focus: Reviewed the authoritative diff for the changed Iceberg V2 delete, reader, and test paths. No additional user-provided focus was supplied.
  • Correctness/schema compatibility: Issues found in equality-delete row sizing and BY_NAME schema-evolution binding.
  • Lifecycle/cache: Issue found in shared delete-file cache scoping across split filesystem identities.
  • Tests: Added tests cover useful positive paths but miss the accepted edge cases, and one regression leaks session state on failure.
  • Validation: Static review only; per the review prompt I did not build, run tests, or modify source. .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc are absent in this checkout.

Comment thread be/src/format_v2/expr/equality_delete_predicate.cpp Outdated
// Migrated Hive tables may have no field ids in their physical files. Once the mapper has
// selected BY_NAME mode, bind the delete key by its delete-file name or by the table column's
// historical name mapping, exactly as normal column materialization does for a renamed field.
const auto table_field_it = std::ranges::find_if(

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.

This lookup makes equality-delete binding depend on the query projection. _projected_columns comes from the scan's required slots, so a query that reads only data or count(*) does not necessarily include the equality key's table metadata. For an old field-id-less file with physical legacy_id, a current table field current_id with name_mapping = legacy_id, and an equality delete file for field id 0 named current_id, the test where current_id is projected works, but SELECT data ... reaches this code with no table field for id 0. The fallback then treats the key as a missing column and uses a NULL literal, so a non-null delete key like current_id = 2 will not delete the row. Equality-delete key binding needs to use table schema/history metadata independent of the selected columns, or add the delete key as a hidden mapping before resolving the data file field.

Comment thread be/src/format_v2/table/iceberg_reader.cpp Outdated
Comment thread be/src/format_v2/table/iceberg_reader.cpp Outdated
@github-actions github-actions Bot dismissed their stale review July 12, 2026 13:07

Superseded by review 4680092049 after repairing inline anchors.

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 12, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Follow-up review found that equality-delete evaluation could derive a zero batch size from an unread first block column, BY_NAME equality-key binding depended on query projection and did not share the mapper's complete name semantics, and parsed delete-file caches were not isolated by filesystem identity. It also found that the Iceberg regression suite could leak its FileScannerV2 session override after a failure. Derive predicate row count from populated block columns, resolve hidden equality keys from the complete current table schema through the common BY_NAME matcher, include fs_name in both delete cache keys, and restore the session variable in a finally block.

### Release note

Fix Iceberg V2 equality and position delete handling for lazy reads, schema evolution, and multi-filesystem scans.

### Check List (For Author)

- Test: Unit Test / Regression test
    - `EqualityDeletePredicateTest.*:IcebergV2ReaderTest.Iceberg*Delete*` (29 tests)
    - Iceberg schema-evolution regression suite loaded successfully; external Iceberg data execution was disabled by the validation environment
- Behavior changed: Yes, V2 delete filtering now uses reliable batch sizing, complete schema name mapping, and filesystem-scoped caches
- Does this need documentation: No
@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.

Automated review completed after three rounds, including main-agent risk scan, full-review subagents, risk-focused subagents, candidate verification, duplicate suppression against existing threads, and final convergence.

I found three additional blocking issues in the current head:

  • Missing equality-delete keys are always compared as NULL, which does not preserve Iceberg initial-default/default semantics for old files.
  • Equality-delete cache keys are still structurally ambiguous when raw paths are concatenated with colon-prefixed field ids.
  • IcebergTableReader::prepare_split() now reads SplitReadOptions::cache unconditionally even though the pointer has no default initializer.

Checkpoint conclusions: data correctness is still at risk for equality deletes in the missing/defaulted-column and cache-collision cases; lifecycle/test determinism is at risk for the uninitialized cache pointer; concurrency did not show a distinct new issue; position-delete grouping/bounds and delete-conjunct polarity were rechecked without additional non-duplicate findings; no configuration, persistence, FE-BE protocol, or observability change requires a separate comment here.

User focus: no additional user-provided focus was supplied.

Validation: static review only. I did not build or run tests, per the review instructions for this GitHub Actions review environment.

Comment thread be/src/format_v2/table/iceberg_reader.cpp Outdated
Comment thread be/src/format_v2/table/iceberg_reader.cpp
Comment thread be/src/format_v2/table/iceberg_reader.cpp
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 12, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg V2 equality delete handling could treat fields missing from old data files as NULL even when the field has a non-null initial default. Delete-file cache keys also allowed structural collisions between raw paths and appended equality field ids, and split cache pointers could be read before initialization. Carry Iceberg initial defaults through FE and BE schema metadata, use them for missing equality keys, length-encode cache key components, and initialize the split cache pointer. The existing lazy-batch row-count fix prevents the attached equality-delete filter-size coredump.

### Release note

Fix Iceberg V2 equality and position delete correctness across schema evolution and cached splits.

### Check List (For Author)

- Test: Regression test / Unit Test
    - ./build.sh --be --fe
    - EqualityDeletePredicateTest.*:IcebergV2ReaderTest.Iceberg*Delete* (30 passed)
    - ExternalUtilTest, IcebergUtilsTest (25 passed)
- Behavior changed: Yes, missing Iceberg fields use their initial defaults and delete cache keys are structurally isolated
- Does this need documentation: No
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 5:19 PM.
Workflow run: https://github.com/apache/doris/actions/runs/29198769084

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: 29931 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e62593c6ad5bda74410250aadae14782de70105b, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17780	4065	4110	4065
q2	2014	337	203	203
q3	10563	1464	846	846
q4	4759	474	346	346
q5	8280	859	578	578
q6	324	168	138	138
q7	849	859	629	629
q8	10645	1640	1588	1588
q9	5934	4449	4422	4422
q10	6853	1813	1500	1500
q11	513	347	315	315
q12	722	570	431	431
q13	18105	3426	2809	2809
q14	271	267	251	251
q15	q16	780	776	712	712
q17	1026	1002	929	929
q18	6795	5695	5663	5663
q19	1164	1293	1148	1148
q20	744	650	532	532
q21	5541	2627	2526	2526
q22	436	359	300	300
Total cold run time: 104098 ms
Total hot run time: 29931 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4388	4328	4292	4292
q2	279	319	212	212
q3	4547	4965	4427	4427
q4	2063	2143	1383	1383
q5	4481	4355	4352	4352
q6	223	180	203	180
q7	2355	1897	1694	1694
q8	2547	2281	2263	2263
q9	8255	7831	7921	7831
q10	4769	4726	4250	4250
q11	578	479	425	425
q12	774	763	577	577
q13	3218	3610	2902	2902
q14	294	291	277	277
q15	q16	709	718	651	651
q17	1351	1553	1321	1321
q18	7948	7356	7335	7335
q19	1079	1049	1098	1049
q20	2230	2215	1930	1930
q21	5266	4636	4490	4490
q22	514	457	412	412
Total cold run time: 57868 ms
Total hot run time: 52253 ms

@hello-stephen

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

query5	4327	633	492	492
query6	471	223	206	206
query7	4950	610	336	336
query8	341	185	172	172
query9	8805	4102	4069	4069
query10	464	362	284	284
query11	5885	2348	2154	2154
query12	160	105	103	103
query13	1296	634	428	428
query14	6310	5290	4987	4987
query14_1	4328	4296	4277	4277
query15	216	209	180	180
query16	1035	475	456	456
query17	1109	704	586	586
query18	2471	471	354	354
query19	203	182	146	146
query20	111	106	106	106
query21	225	161	133	133
query22	13664	13657	13384	13384
query23	17419	16531	16129	16129
query23_1	16364	16335	16208	16208
query24	7491	1774	1280	1280
query24_1	1313	1309	1301	1301
query25	554	454	396	396
query26	1325	355	215	215
query27	2579	617	371	371
query28	4514	2024	2037	2024
query29	1113	644	509	509
query30	343	273	233	233
query31	1114	1094	979	979
query32	111	64	64	64
query33	533	341	275	275
query34	1185	1132	650	650
query35	770	826	683	683
query36	1428	1399	1217	1217
query37	156	109	97	97
query38	1874	1713	1647	1647
query39	926	919	933	919
query39_1	865	882	887	882
query40	254	162	143	143
query41	71	104	61	61
query42	92	95	93	93
query43	325	322	286	286
query44	1414	754	771	754
query45	200	184	180	180
query46	1079	1229	748	748
query47	2367	2381	2225	2225
query48	404	399	303	303
query49	582	416	317	317
query50	1165	428	338	338
query51	10937	11030	11044	11030
query52	85	89	74	74
query53	256	293	204	204
query54	283	232	213	213
query55	74	72	65	65
query56	290	296	294	294
query57	1418	1408	1319	1319
query58	278	260	252	252
query59	1588	1714	1497	1497
query60	299	275	260	260
query61	154	153	152	152
query62	699	646	560	560
query63	242	200	201	200
query64	2829	1046	841	841
query65	4884	4765	4761	4761
query66	1806	522	440	440
query67	29611	29530	29291	29291
query68	3189	1519	1033	1033
query69	413	308	271	271
query70	1094	994	980	980
query71	348	324	317	317
query72	3040	2733	2483	2483
query73	796	819	472	472
query74	5093	4957	4751	4751
query75	2619	2604	2213	2213
query76	2332	1201	800	800
query77	355	376	288	288
query78	12181	12269	11670	11670
query79	1274	1106	787	787
query80	583	537	439	439
query81	458	320	290	290
query82	235	157	122	122
query83	311	317	295	295
query84	270	161	127	127
query85	886	582	516	516
query86	335	295	272	272
query87	1813	1815	1759	1759
query88	3685	2868	2777	2777
query89	429	403	373	373
query90	2166	194	200	194
query91	199	187	161	161
query92	63	61	58	58
query93	1485	1505	1006	1006
query94	534	372	318	318
query95	781	503	484	484
query96	1132	812	357	357
query97	2681	2699	2545	2545
query98	219	213	206	206
query99	1163	1179	1047	1047
Total cold run time: 264672 ms
Total hot run time: 180574 ms

@hello-stephen

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

query1	0.01	0.00	0.00
query2	0.09	0.05	0.05
query3	0.26	0.13	0.13
query4	1.62	0.14	0.14
query5	0.24	0.23	0.23
query6	1.24	1.06	1.09
query7	0.04	0.01	0.00
query8	0.06	0.04	0.03
query9	0.40	0.31	0.31
query10	0.56	0.55	0.54
query11	0.20	0.15	0.14
query12	0.17	0.15	0.15
query13	0.46	0.47	0.48
query14	1.03	1.02	1.01
query15	0.61	0.59	0.59
query16	0.32	0.33	0.32
query17	1.16	1.09	1.12
query18	0.22	0.21	0.22
query19	2.05	1.97	1.98
query20	0.02	0.01	0.02
query21	15.45	0.23	0.13
query22	4.70	0.06	0.05
query23	16.12	0.31	0.13
query24	2.96	0.43	0.33
query25	0.12	0.05	0.05
query26	0.73	0.21	0.15
query27	0.04	0.04	0.04
query28	3.51	0.89	0.52
query29	12.47	4.04	3.19
query30	0.29	0.16	0.17
query31	2.77	0.58	0.32
query32	3.22	0.59	0.48
query33	3.21	3.22	3.16
query34	15.52	4.26	3.50
query35	3.54	3.50	3.56
query36	0.56	0.43	0.42
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.49 s
Total hot run time: 24.98 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.40% (249/261) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.76% (30190/40381)
Line Coverage 58.76% (331435/564096)
Region Coverage 55.56% (278291/500859)
Branch Coverage 56.77% (122900/216492)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 13, 2026
### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#65502

Problem Summary: The Iceberg equality-delete schema-change regression test indexed the SQL string literal before invoking the sql helper. Groovy therefore attempted to take index 1 from a one-character string and failed before the test queries ran. Store the SQL result rows first, validate that the variable exists, and then extract the session value for restoration.

### Release note

None

### Check List (For Author)

- Test: Regression test
    - Remote minimal regression test covering the same SQL-result extraction passed
- Behavior changed: No
- Does this need documentation: No
@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.

Static review of PR 65502 at head daf0c5006176be580f7599e606fcc4eaaf1d6283. I found one remaining blocker, left inline.

Checkpoint conclusions: goal/scope is clear and the remaining issue is patch-scoped to the new Iceberg initial-default carrier. Concurrency/lifecycle/cache behavior was rechecked against the existing threads and current patch; I found no additional non-duplicated cache or split-lifetime issue. Compatibility and parallel paths were checked for scanner V2 versus fallback, Parquet/ORC delete handling, thrift optionality, and generated outputs; no additional issue found beyond the default-carrier problem. Condition checks and delete-predicate polarity/row sizing were rechecked across BE consumers; no additional issue found. Tests cover integer defaults and several BE delete paths, but miss the timestamp and VARBINARY-mapped default cases called out inline. Observability is not materially changed. Transaction/persistence/data-write boundaries are not directly changed; FE-BE schema/default transport is the relevant boundary and is where the blocker sits. Performance risk appears bounded to the new delete/default handling paths; no extra performance finding. Static review only per prompt; I did not build or run tests.

Comment thread fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java Outdated
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17650	4128	4095	4095
q2	2013	345	200	200
q3	10294	1440	812	812
q4	4682	468	341	341
q5	7519	854	588	588
q6	180	174	142	142
q7	786	840	631	631
q8	9351	1554	1571	1554
q9	5664	4421	4375	4375
q10	6695	1844	1521	1521
q11	530	342	319	319
q12	707	565	449	449
q13	18147	3457	2780	2780
q14	272	260	243	243
q15	q16	796	781	713	713
q17	1010	917	966	917
q18	7139	5868	5530	5530
q19	1157	1268	1077	1077
q20	730	639	541	541
q21	5620	2573	2402	2402
q22	442	376	305	305
Total cold run time: 101384 ms
Total hot run time: 29535 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4469	4365	4375	4365
q2	294	318	222	222
q3	4599	4967	4361	4361
q4	2073	2150	1403	1403
q5	4476	4368	4320	4320
q6	230	177	135	135
q7	1710	2040	1904	1904
q8	2689	2342	2366	2342
q9	8134	8128	7869	7869
q10	4718	4664	4246	4246
q11	589	458	404	404
q12	790	784	557	557
q13	3241	3594	3004	3004
q14	312	314	280	280
q15	q16	717	738	654	654
q17	1385	1331	1351	1331
q18	8079	7466	7378	7378
q19	1152	1132	1099	1099
q20	2220	2213	1945	1945
q21	5270	4625	4550	4550
q22	520	450	404	404
Total cold run time: 57667 ms
Total hot run time: 52773 ms

@hello-stephen

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

query5	4360	618	494	494
query6	446	214	223	214
query7	4841	590	348	348
query8	336	184	173	173
query9	8775	4114	4073	4073
query10	482	365	286	286
query11	5938	2366	2173	2173
query12	163	103	106	103
query13	1265	629	450	450
query14	6888	5340	4970	4970
query14_1	4293	4307	4332	4307
query15	217	205	185	185
query16	1044	486	485	485
query17	1292	735	593	593
query18	2712	477	358	358
query19	284	196	162	162
query20	117	107	110	107
query21	231	159	137	137
query22	13653	13558	13320	13320
query23	17397	16563	16237	16237
query23_1	16255	16284	16318	16284
query24	7495	1789	1322	1322
query24_1	1330	1315	1323	1315
query25	570	469	401	401
query26	1299	374	220	220
query27	2484	601	389	389
query28	4374	2063	2039	2039
query29	1093	654	511	511
query30	339	261	234	234
query31	1139	1100	983	983
query32	104	64	61	61
query33	547	338	274	274
query34	1211	1149	658	658
query35	763	811	666	666
query36	1395	1390	1243	1243
query37	162	159	92	92
query38	1870	1710	1634	1634
query39	916	921	898	898
query39_1	877	870	884	870
query40	239	161	136	136
query41	65	61	61	61
query42	94	92	94	92
query43	327	325	278	278
query44	1411	773	766	766
query45	196	199	178	178
query46	1029	1186	749	749
query47	2386	2349	2243	2243
query48	406	370	296	296
query49	584	437	314	314
query50	1037	442	350	350
query51	10903	10797	10802	10797
query52	93	89	76	76
query53	264	275	204	204
query54	281	248	228	228
query55	79	71	73	71
query56	297	284	270	270
query57	1418	1421	1326	1326
query58	290	258	265	258
query59	1536	1630	1462	1462
query60	322	269	261	261
query61	160	152	155	152
query62	707	656	582	582
query63	253	202	207	202
query64	2791	1008	906	906
query65	4886	4739	4761	4739
query66	1767	510	384	384
query67	29560	29511	29350	29350
query68	3128	1581	1007	1007
query69	413	311	266	266
query70	1072	994	956	956
query71	340	315	319	315
query72	3125	2693	2388	2388
query73	874	765	460	460
query74	5123	4965	4751	4751
query75	2618	2604	2249	2249
query76	2324	1193	765	765
query77	358	370	274	274
query78	12120	12350	11765	11765
query79	1442	1182	807	807
query80	1323	518	471	471
query81	539	326	278	278
query82	656	163	125	125
query83	389	321	297	297
query84	284	158	127	127
query85	956	606	530	530
query86	440	290	261	261
query87	1841	1832	1727	1727
query88	3717	2834	2836	2834
query89	464	402	367	367
query90	1959	193	201	193
query91	209	195	165	165
query92	65	65	60	60
query93	1730	1448	957	957
query94	714	350	331	331
query95	787	504	478	478
query96	1068	756	357	357
query97	2683	2653	2551	2551
query98	210	207	198	198
query99	1151	1168	1031	1031
Total cold run time: 266816 ms
Total hot run time: 180849 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.04
query3	0.26	0.13	0.14
query4	1.61	0.15	0.13
query5	0.24	0.23	0.23
query6	1.26	1.08	1.08
query7	0.04	0.01	0.00
query8	0.06	0.03	0.04
query9	0.40	0.32	0.33
query10	0.58	0.59	0.55
query11	0.20	0.14	0.14
query12	0.18	0.14	0.14
query13	0.47	0.47	0.48
query14	1.03	1.01	1.01
query15	0.61	0.58	0.61
query16	0.33	0.33	0.33
query17	1.08	1.16	1.10
query18	0.23	0.22	0.23
query19	2.03	1.97	1.98
query20	0.01	0.01	0.01
query21	15.44	0.23	0.13
query22	4.70	0.05	0.05
query23	16.11	0.32	0.12
query24	2.93	0.42	0.33
query25	0.11	0.06	0.05
query26	0.76	0.20	0.15
query27	0.04	0.04	0.04
query28	3.52	0.89	0.53
query29	12.47	4.14	3.26
query30	0.28	0.16	0.17
query31	2.78	0.57	0.31
query32	3.22	0.58	0.49
query33	3.15	3.30	3.22
query34	15.55	4.22	3.52
query35	3.54	3.51	3.53
query36	0.56	0.45	0.43
query37	0.10	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.02
query40	0.17	0.16	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.42 s
Total hot run time: 25.15 s

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 13, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg equality-delete keys can be absent from older data files after schema evolution. Both scanner implementations treated such keys as NULL even when Iceberg assigned a non-null initial default, and the default carrier was not type-safe for timestamp and VARBINARY-mapped values. This change sends complete current schema metadata, normalizes initial defaults by type, materializes missing keys in FileScanner V1, and builds typed missing-key expressions in FileScanner V2. It preserves Iceberg type promotion when the table and delete-file key types differ.

### Release note

Fix Iceberg equality deletes for evolved columns with initial defaults in FileScanner V1 and V2.

### Check List (For Author)

- Test: Unit Test
    - Remote BE ASAN build
    - 3 focused Iceberg BE unit tests
    - IcebergUtilsTest#testParseSchemaPreservesInitialDefault
    - C++ format check
- Behavior changed: Yes, both file scanners now apply equality deletes using the logical Iceberg initial value for columns absent from older files
- Does this need documentation: No
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 13, 2026
### What problem does this PR solve?

Issue Number: close #0

Related PR: apache#65502

Problem Summary: Format the missing Iceberg equality-delete key helper with the project clang-format 16 style.

### Release note

None

### Check List (For Author)

- Test: No need to test (format-only change); clang-format 16 verification passed
- Behavior changed: No
- Does this need documentation: No
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 13, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg equality-delete keys can be hidden from the query projection, absent from older data files, or mapped by historical names. V1 ORC attempted to read absent keys as physical columns, BY_NAME resolution could select stale field IDs, and binary or timestamptz initial defaults could lose their physical representation. Preserve complete schema metadata, resolve BY_NAME keys only by names and aliases, delay missing-key materialization until the batch row count is known, preserve binary defaults through an explicit Base64 marker, and inherit timestamp-with-zone mapping for delete readers.

### Release note

Fix Iceberg equality-delete filtering across schema evolution, binary mappings, ORC files, and timestamp-with-zone values.

### Check List (For Author)

- Test:
    - Unit Test: 65 focused BE Iceberg and equality-delete tests passed
    - Unit Test: 25 focused FE schema and Iceberg utility tests passed
- Behavior changed: Yes, equality deletes now use correct schema mappings and initial-default representations
- Does this need documentation: No
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 13, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg equality-delete handling could bind stale field ids in BY_NAME mode, lose binary initial-default bytes, treat missing V1 keys as physical columns, select id-less fields by stale ids, derive binary defaults from the latest schema instead of the selected snapshot, and read delete-file TIMESTAMPTZ keys without the data reader mapping option. Complex schema rematerialization could also trust a nested descriptor that omitted nullability, producing Struct(String) under a Struct(Nullable(String)) output type. This change uses shared name mapping, carries lossless binary defaults from the selected snapshot schema, materializes absent V1 keys as full columns, propagates TIMESTAMPTZ mapping, and treats the parent complex DataType as the authoritative child-type contract.

### Release note

Fix Iceberg equality deletes for evolved schemas, binary defaults, missing V1 keys, TIMESTAMPTZ keys, and nullable nested fields.

### Check List (For Author)

- Test: Unit Test
    - 17 focused BE ASAN tests covering Iceberg readers, the nullable renamed struct reproduction, and rebase compatibility
    - 5 existing complex projection/materialization BE ASAN tests
    - 17 Iceberg DDL/DML planning FE tests
    - 29 FE tests in ExternalUtilTest, IcebergUtilsTest, and IcebergScanNodeTest
    - Targeted clang-format 16 check
- Behavior changed: Yes, equality deletes and evolved complex columns now resolve and materialize using the correct mapping, snapshot schema, and authoritative table types
- Does this need documentation: No
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.39% (1896/2450)
Line Coverage 64.42% (34053/52862)
Region Coverage 64.86% (17532/27032)
Branch Coverage 54.03% (9396/17390)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17776	4089	4024	4024
q2	2032	313	195	195
q3	10333	1374	799	799
q4	4734	469	337	337
q5	7833	853	564	564
q6	241	166	134	134
q7	749	830	634	634
q8	10434	1575	1508	1508
q9	5794	4348	4327	4327
q10	6823	1797	1515	1515
q11	492	362	320	320
q12	739	547	425	425
q13	18164	3391	2776	2776
q14	272	255	243	243
q15	q16	786	784	708	708
q17	2414	1079	892	892
q18	6936	5684	5513	5513
q19	1680	1232	964	964
q20	741	635	549	549
q21	5872	2684	2490	2490
q22	434	349	296	296
Total cold run time: 105279 ms
Total hot run time: 29213 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4386	4239	4278	4239
q2	281	313	234	234
q3	4546	5017	4387	4387
q4	2071	2164	1346	1346
q5	4399	4286	4266	4266
q6	227	180	201	180
q7	2193	1865	1568	1568
q8	2497	2101	2112	2101
q9	7810	7762	7805	7762
q10	4699	4690	4249	4249
q11	662	399	381	381
q12	774	783	560	560
q13	3345	3492	3077	3077
q14	305	321	273	273
q15	q16	717	730	646	646
q17	1341	1305	1301	1301
q18	7932	7335	6967	6967
q19	1061	1046	1069	1046
q20	2211	2198	1939	1939
q21	5187	4463	4329	4329
q22	511	444	400	400
Total cold run time: 57155 ms
Total hot run time: 51251 ms

@hello-stephen

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

query5	4349	638	482	482
query6	477	221	203	203
query7	4850	568	374	374
query8	348	187	178	178
query9	8757	4030	4063	4030
query10	514	357	328	328
query11	5904	2341	2129	2129
query12	155	104	106	104
query13	1253	632	440	440
query14	6308	5298	4987	4987
query14_1	4320	4288	4273	4273
query15	224	213	185	185
query16	1003	486	420	420
query17	1107	699	570	570
query18	2451	465	336	336
query19	197	180	145	145
query20	112	109	104	104
query21	230	160	132	132
query22	13712	13712	13355	13355
query23	17382	16606	16317	16317
query23_1	16331	16332	16303	16303
query24	7506	1788	1308	1308
query24_1	1338	1323	1304	1304
query25	530	439	367	367
query26	1319	346	196	196
query27	2663	604	380	380
query28	4516	1976	1990	1976
query29	1089	623	473	473
query30	337	263	222	222
query31	1123	1095	997	997
query32	111	61	64	61
query33	536	312	257	257
query34	1175	1134	649	649
query35	792	793	679	679
query36	1401	1377	1227	1227
query37	156	111	97	97
query38	1890	1722	1669	1669
query39	927	925	931	925
query39_1	884	898	881	881
query40	252	160	142	142
query41	73	68	69	68
query42	96	94	91	91
query43	326	328	281	281
query44	1421	792	789	789
query45	203	196	180	180
query46	1092	1210	764	764
query47	2383	2354	2290	2290
query48	423	432	316	316
query49	589	434	346	346
query50	994	455	376	376
query51	10902	10597	10636	10597
query52	90	93	77	77
query53	259	285	212	212
query54	310	246	235	235
query55	79	80	71	71
query56	318	339	291	291
query57	1471	1425	1304	1304
query58	300	267	264	264
query59	1627	1617	1411	1411
query60	334	288	263	263
query61	183	202	150	150
query62	707	650	589	589
query63	246	204	212	204
query64	2827	1036	883	883
query65	4896	4784	4786	4784
query66	1800	502	384	384
query67	29798	29529	29382	29382
query68	3205	1529	982	982
query69	402	312	276	276
query70	1118	983	969	969
query71	366	319	314	314
query72	3064	2759	2345	2345
query73	858	822	413	413
query74	5148	5015	4804	4804
query75	2622	2587	2249	2249
query76	2344	1182	755	755
query77	367	384	286	286
query78	12170	12226	11790	11790
query79	1300	1110	776	776
query80	660	537	451	451
query81	459	330	281	281
query82	563	163	122	122
query83	408	318	296	296
query84	280	160	133	133
query85	955	606	538	538
query86	377	298	272	272
query87	1816	1822	1775	1775
query88	3737	2769	2745	2745
query89	442	423	364	364
query90	1955	213	195	195
query91	207	193	167	167
query92	63	61	57	57
query93	1523	1436	989	989
query94	549	352	332	332
query95	790	523	558	523
query96	1032	770	351	351
query97	2668	2676	2569	2569
query98	217	207	202	202
query99	1187	1179	1035	1035
Total cold run time: 265534 ms
Total hot run time: 180325 ms

@hello-stephen

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

query1	0.00	0.01	0.01
query2	0.14	0.08	0.08
query3	0.38	0.25	0.24
query4	1.60	0.24	0.26
query5	0.33	0.32	0.31
query6	1.16	0.68	0.68
query7	0.04	0.00	0.01
query8	0.09	0.08	0.07
query9	0.50	0.38	0.38
query10	0.59	0.58	0.58
query11	0.32	0.18	0.18
query12	0.33	0.20	0.19
query13	0.52	0.52	0.53
query14	0.94	0.92	0.92
query15	0.68	0.60	0.60
query16	0.39	0.39	0.38
query17	1.03	1.00	1.01
query18	0.31	0.30	0.29
query19	1.91	1.81	1.80
query20	0.02	0.02	0.01
query21	15.42	0.37	0.32
query22	4.90	0.14	0.14
query23	15.85	0.49	0.30
query24	2.53	0.62	0.43
query25	0.15	0.11	0.10
query26	0.74	0.28	0.21
query27	0.09	0.10	0.10
query28	3.41	0.88	0.53
query29	12.46	4.24	3.29
query30	0.38	0.26	0.27
query31	2.77	0.62	0.34
query32	3.24	0.61	0.46
query33	2.92	3.00	3.01
query34	15.67	4.09	3.37
query35	3.30	3.30	3.29
query36	0.66	0.52	0.51
query37	0.14	0.09	0.10
query38	0.09	0.07	0.07
query39	0.08	0.07	0.06
query40	0.21	0.20	0.17
query41	0.13	0.09	0.08
query42	0.09	0.07	0.07
query43	0.08	0.08	0.07
Total cold run time: 96.59 s
Total hot run time: 25.74 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 88.33% (53/60) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg equality-delete handling could bind stale field ids in BY_NAME mode, lose binary initial-default bytes, treat missing V1 keys as physical columns, select id-less fields by stale ids, derive binary defaults from the latest schema instead of the selected snapshot, and read delete-file TIMESTAMPTZ keys without the data reader mapping option. Complex schema rematerialization could also trust a nested descriptor that omitted nullability, producing Struct(String) under a Struct(Nullable(String)) output type. This change uses shared name mapping, carries lossless binary defaults from the selected snapshot schema, materializes absent V1 keys as full columns, propagates TIMESTAMPTZ mapping, and treats the parent Struct DataType as the authoritative child-type contract while preserving Array and Map wrapper semantics.

### Release note

Fix Iceberg equality deletes for evolved schemas, binary defaults, missing V1 keys, TIMESTAMPTZ keys, and nullable nested fields.

### Check List (For Author)

- Test: Unit Test
    - 17 focused BE ASAN tests covering Iceberg readers, the nullable renamed struct reproduction, and rebase compatibility
    - 5 existing complex projection/materialization BE ASAN tests
    - 175 ColumnMapper and TableReader BE ASAN tests
    - 17 Iceberg DDL/DML planning FE tests
    - 29 FE tests in ExternalUtilTest, IcebergUtilsTest, and IcebergScanNodeTest
    - Targeted clang-format 16 check
- Behavior changed: Yes, equality deletes and evolved complex columns now resolve and materialize using the correct mapping, snapshot schema, and authoritative table types
- Does this need documentation: No
@Gabriel39 Gabriel39 force-pushed the codex/fix-v2-iceberg-delete-handling branch from 189521b to 37cc0f8 Compare July 13, 2026 14:35
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17610	4090	4030	4030
q2	2032	326	195	195
q3	10266	1399	824	824
q4	4682	473	341	341
q5	7553	852	596	596
q6	192	171	134	134
q7	759	837	643	643
q8	9353	1529	1586	1529
q9	5703	4412	4411	4411
q10	6783	1795	1528	1528
q11	499	340	309	309
q12	709	550	415	415
q13	18074	3413	2769	2769
q14	267	258	246	246
q15	q16	797	779	711	711
q17	983	989	1017	989
q18	6767	5952	5608	5608
q19	1149	1240	1053	1053
q20	763	655	583	583
q21	5579	2570	2391	2391
q22	432	351	295	295
Total cold run time: 100952 ms
Total hot run time: 29600 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4337	4261	4265	4261
q2	280	318	217	217
q3	4555	5004	4428	4428
q4	2046	2165	1351	1351
q5	4435	4308	4314	4308
q6	230	171	124	124
q7	1721	1619	2087	1619
q8	2575	2183	2163	2163
q9	8056	8261	7833	7833
q10	4704	4758	4231	4231
q11	580	430	389	389
q12	760	764	552	552
q13	3224	3619	2895	2895
q14	324	313	281	281
q15	q16	704	772	646	646
q17	1331	1304	1296	1296
q18	8190	7211	7219	7211
q19	1155	1090	1129	1090
q20	2206	2215	1958	1958
q21	5231	4546	4371	4371
q22	518	451	383	383
Total cold run time: 57162 ms
Total hot run time: 51607 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.39% (1896/2450)
Line Coverage 64.47% (34080/52862)
Region Coverage 64.91% (17546/27032)
Branch Coverage 54.09% (9407/17390)

@hello-stephen

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

query5	4319	638	506	506
query6	470	215	207	207
query7	4836	603	328	328
query8	333	181	181	181
query9	8767	4064	4032	4032
query10	476	356	307	307
query11	5952	2352	2153	2153
query12	153	104	102	102
query13	1271	648	421	421
query14	6261	5276	4995	4995
query14_1	4289	4287	4272	4272
query15	226	208	189	189
query16	1038	478	459	459
query17	1046	748	592	592
query18	2474	494	354	354
query19	210	195	167	167
query20	118	112	108	108
query21	241	165	131	131
query22	13559	13623	13454	13454
query23	17319	16634	16163	16163
query23_1	16296	16164	16407	16164
query24	7510	1767	1280	1280
query24_1	1321	1304	1312	1304
query25	547	441	359	359
query26	1320	345	203	203
query27	2614	576	375	375
query28	4424	1998	2002	1998
query29	1061	597	477	477
query30	333	259	226	226
query31	1127	1111	1003	1003
query32	121	60	66	60
query33	525	316	253	253
query34	1191	1145	660	660
query35	781	787	692	692
query36	1465	1470	1330	1330
query37	153	109	92	92
query38	1926	1752	1673	1673
query39	956	949	906	906
query39_1	928	919	921	919
query40	254	160	140	140
query41	69	65	65	65
query42	94	94	101	94
query43	327	328	294	294
query44	1476	786	794	786
query45	205	191	178	178
query46	1113	1301	718	718
query47	2401	2423	2267	2267
query48	405	420	313	313
query49	589	427	323	323
query50	1020	417	338	338
query51	10648	10969	10729	10729
query52	85	85	75	75
query53	256	271	204	204
query54	270	249	219	219
query55	74	71	66	66
query56	312	276	284	276
query57	1442	1395	1314	1314
query58	286	254	258	254
query59	1570	1630	1467	1467
query60	301	257	250	250
query61	160	153	145	145
query62	705	644	587	587
query63	238	208	203	203
query64	2990	1046	835	835
query65	4860	4793	4775	4775
query66	1829	503	392	392
query67	29491	28975	28725	28725
query68	3194	1543	1053	1053
query69	407	314	268	268
query70	1071	966	968	966
query71	353	331	304	304
query72	3017	2690	2283	2283
query73	848	853	433	433
query74	5106	4978	4763	4763
query75	2595	2570	2224	2224
query76	2308	1172	756	756
query77	359	384	282	282
query78	12442	12196	11672	11672
query79	1375	1118	756	756
query80	754	573	459	459
query81	490	327	277	277
query82	561	154	123	123
query83	381	323	288	288
query84	306	159	130	130
query85	984	597	515	515
query86	423	292	295	292
query87	1820	1822	1740	1740
query88	3690	2782	2761	2761
query89	454	408	352	352
query90	1777	190	197	190
query91	199	192	168	168
query92	66	59	57	57
query93	1549	1712	1039	1039
query94	670	349	336	336
query95	759	517	455	455
query96	1122	751	336	336
query97	2702	2702	2564	2564
query98	216	207	200	200
query99	1186	1172	1033	1033
Total cold run time: 265075 ms
Total hot run time: 179855 ms

@hello-stephen

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

query1	0.00	0.01	0.00
query2	0.10	0.05	0.05
query3	0.25	0.14	0.14
query4	1.63	0.15	0.14
query5	0.25	0.23	0.23
query6	1.23	1.10	1.03
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.38	0.31	0.32
query10	0.59	0.55	0.54
query11	0.20	0.14	0.14
query12	0.19	0.14	0.15
query13	0.48	0.48	0.47
query14	1.02	1.02	1.02
query15	0.61	0.58	0.60
query16	0.32	0.31	0.34
query17	1.11	1.13	1.11
query18	0.23	0.21	0.22
query19	1.98	1.94	1.98
query20	0.01	0.02	0.01
query21	15.41	0.22	0.13
query22	4.83	0.06	0.04
query23	16.19	0.30	0.12
query24	2.97	0.45	0.32
query25	0.12	0.05	0.05
query26	0.73	0.22	0.16
query27	0.04	0.04	0.03
query28	3.49	0.92	0.56
query29	12.48	4.09	3.24
query30	0.27	0.15	0.15
query31	2.78	0.60	0.32
query32	3.22	0.59	0.49
query33	3.18	3.16	3.19
query34	15.56	4.26	3.56
query35	3.54	3.51	3.53
query36	0.57	0.43	0.42
query37	0.09	0.07	0.06
query38	0.04	0.04	0.04
query39	0.04	0.02	0.03
query40	0.18	0.16	0.16
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.57 s
Total hot run time: 25.04 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 93.38% (536/574) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.07% (23676/41483)
Line Coverage 40.79% (232039/568910)
Region Coverage 36.66% (183350/500105)
Branch Coverage 37.78% (82008/217044)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 88.33% (53/60) 🎉
Increment coverage report
Complete coverage report

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

Static review completed for PR 65502.

I found one blocking V1 Iceberg reader issue and left it inline. The rest of the reviewed V2 equality-delete/default/cache/row-count paths either look addressed by this patch or are already covered by existing review threads, so I did not duplicate those comments.

Part 1.3 checkpoint conclusions:

  • Goal and tests: the PR largely targets Iceberg equality-delete correctness across schema changes/defaults and adds relevant BE/FE/regression coverage, but the V1 metadata-column path is still missing coverage and has the inline failure below.
  • Scope and focus: the change is focused on Iceberg reader/default/equality-delete plumbing; the remaining issue is in a parallel V1 init path touched by the patch.
  • Concurrency and lifecycle: no new thread-safety, lock-order, static-init, or lifecycle defect found; the reviewed delete-file cache is scanner/operator local.
  • Configuration: no new config item found.
  • Compatibility and protocol: new thrift fields are optional append-only fields; rolling/pruned-descriptor default concerns were checked and are duplicate-covered by existing comments.
  • Parallel paths: V1 Parquet/ORC and V2 paths were checked. The accepted issue affects V1 Parquet and the ORC twin; V2 does not use this StructNode tuple-slot lookup path.
  • Conditions and error handling: most new checks follow existing patterns, but the inline issue treats every tuple slot as present in StructNode, which is false for non-file-backed global row-id metadata slots.
  • Test coverage and results: tests were reviewed statically; I did not run builds or tests per the review prompt. This runner also lacks .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc.
  • Observability, persistence, and writes: no new observability, persistence/EditLog, or data-write transaction issue found for this read-path change.
  • Performance: no additional non-duplicate performance issue found after checking cache keying/lifetime and delete predicate row sizing.
  • User focus: no additional user-provided focus was present.

Comment thread be/src/format/table/iceberg_reader.cpp
@github-actions

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 Jul 14, 2026
@Gabriel39 Gabriel39 changed the title [fix](be) Correct FileScannerV2 Iceberg delete handling [fix](be) Fix Iceberg row-level deletes across schema evolution Jul 14, 2026
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 94.63% (529/559) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.84% (30284/40463)
Line Coverage 58.90% (332962/565313)
Region Coverage 55.61% (279143/501990)
Branch Coverage 56.88% (123498/217127)

@Gabriel39 Gabriel39 merged commit 7604fbf into apache:master Jul 14, 2026
31 of 33 checks passed
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 14, 2026
Issue Number: None

Related PR: apache#65502

Problem Summary: Iceberg equality-delete handling could bind stale field ids in BY_NAME mode, lose binary initial-default bytes, treat missing V1 keys as physical columns, select id-less fields by stale ids, derive binary defaults from the latest schema instead of the selected snapshot, and read delete-file TIMESTAMPTZ keys without the data reader mapping option. Complex schema rematerialization could also trust a nested descriptor that omitted nullability, producing Struct(String) under a Struct(Nullable(String)) output type. This change uses shared name mapping, carries lossless binary defaults from the selected snapshot schema, materializes absent V1 keys as full columns, propagates TIMESTAMPTZ mapping, and treats the parent Struct DataType as the authoritative child-type contract while preserving Array and Map wrapper semantics.

Fix Iceberg equality deletes for evolved schemas, binary defaults, missing V1 keys, TIMESTAMPTZ keys, and nullable nested fields.

- Test: Unit Test
    - 17 focused BE ASAN tests covering Iceberg readers, the nullable renamed struct reproduction, and rebase compatibility
    - 5 existing complex projection/materialization BE ASAN tests
    - 175 ColumnMapper and TableReader BE ASAN tests
    - 17 Iceberg DDL/DML planning FE tests
    - 29 FE tests in ExternalUtilTest, IcebergUtilsTest, and IcebergScanNodeTest
    - Targeted clang-format 16 check
- Behavior changed: Yes, equality deletes and evolved complex columns now resolve and materialize using the correct mapping, snapshot schema, and authoritative table types
- Does this need documentation: No
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants