Skip to content

[feature](iceberg) Support Iceberg V3 default values - #65851

Open
hubgeter wants to merge 36 commits into
apache:masterfrom
hubgeter:feature/iceberg-v3-defaults
Open

[feature](iceberg) Support Iceberg V3 default values#65851
hubgeter wants to merge 36 commits into
apache:masterfrom
hubgeter:feature/iceberg-v3-defaults

Conversation

@hubgeter

@hubgeter hubgeter commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #65329

Problem Summary:
Iceberg V3 separates initial-default, used when an older data file does not contain a field ID, from write-default, used when a writer omits a known field or explicitly requests DEFAULT. Doris previously returned NULL for absent fields and did not consume Iceberg write defaults. Equality-delete history, mixed-version readers, filtered delete planning, and concurrent schema evolution could also produce inconsistent results.

This change:

  • carries typed Iceberg initial-default metadata recursively by field ID and materializes missing primitive and complex values independently in File Scanner V1 and V2 for Parquet and ORC;
  • preserves physically stored values, explicit NULL values, parent NULL values, and required-field failures;
  • keeps equality-delete keys bound to historical field IDs and names, derives required keys only from deletes applicable to the filtered scan tasks, and uses a versioned rolling-upgrade fence;
  • pins the current table schema, branch target, and format version once per write statement without refreshing the shared frozen read table, then validates the commit against freshly loaded mutable metadata;
  • uses typed write-default values for omitted columns, explicit DEFAULT, UPDATE, matched MERGE, and MERGE NOT MATCHED INSERT, preserving the referenced field in DEFAULT(column) and rejecting unknown references;
  • verifies UUID, FIXED, and BINARY byte values in mapped and legacy carriers, including Doris-written Parquet and ORC rows read back by Spark-Iceberg.

CREATE/ALTER syntax for authoring or evolving Iceberg default metadata remains out of scope.

Release note

Support Iceberg V3 initial defaults when reading fields absent from older data files and write defaults for omitted columns or explicit DEFAULT values when writing Iceberg tables.

UPDATE and matched/not-matched MERGE resolve DEFAULT(column) from the statement-pinned Iceberg write schema. Branch-targeted writes commit to the selected branch lineage while using Iceberg’s table-global current schema; columns added or renamed after the branch point are immediately part of the writer schema. Iceberg initial/write defaults remain separate from Doris column defaults, so DESC and SHOW CREATE TABLE do not display either value as a generic Doris default.

Check List (For Author)

  • Test

    • Regression test
      • test_iceberg_initial_defaults
      • iceberg_branch_tag_schema_change_extended
      • test_iceberg_schema_ref_actions_matrix
      • test_iceberg_partition_evolution_equality_delete
    • Unit Test
      • Focused FE tests: 296/296 across 12 classes (262 connector + 34 FE core)
      • Focused BE tests: 366/366 across 17 suites
    • Manual test
      • Full ASAN FE+BE build with ./build.sh --fe --be -j16
      • ASAN BE UT binary rebuilt and focused tests run with ./run-be-ut.sh
      • C++ format check and git diff --check
    • No need to test or manual test
  • Behavior changed:

    • No.
    • Yes. Iceberg V3 reads and writes now apply the corresponding default-value contract, filtered scans preflight only applicable equality deletes, and branch-targeted writes use the table-global current schema while committing to the selected branch lineage.
  • Does this need documentation?

    • No.
    • Yes. The durable design and user-visible compatibility details are included in docs/iceberg-v3-default-values-design.md.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

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.62% (1908/2458)
Line Coverage 64.43% (34129/52968)
Region Coverage 64.84% (17557/27076)
Branch Coverage 54.03% (9414/17424)

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

Found three blocking issues and am requesting changes.

Critical checkpoint conclusions

  • Goal and behavior: The same-version initial-default design is coherent for fields retained in the selected schema, including nested struct/list/map values and binary-like types. A dropped equality-delete key loses the historical initial-default metadata that Iceberg requires for continued delete application, and recursive defaults can return backend-dependent values during a smooth BE upgrade.
  • Tests and current checks: The fixture meaningfully distinguishes pre-evolution files, immutable initial defaults, later write defaults, and physical NULL/value rows across V1/V2 and Parquet/ORC. The required Check for secrets workflow nevertheless fails on the two new synthetic hex literals. Static review only: the review contract prohibited local builds and test execution.
  • Scope and parallel paths: The patch is focused on Iceberg read-time projection. V1 and V2, Parquet and ORC, ordinary and historical/ref schema selection, predicate paths, and equality-delete integration were audited. The two semantic gaps are called out inline; no separate scanner-path divergence was found.
  • Concurrency, lifecycle, and performance: Default and mapping state is reader-local, expression/mapping cleanup is paired across split/EOF/abort paths, and typed constants are prepared once and expanded with column operations. No additional concurrency, resource-lifetime, or asymptotic performance issue was found.
  • Configuration and compatibility: No configuration default changes. The new Thrift fields are wire-tolerable, but old source BEs do not implement the recursive semantics and remain query-eligible; that mixed-version semantic incompatibility needs an explicit gate or compatible carrier.
  • Conditionals and error propagation: Physical values and physical NULLs correctly take precedence, optional missing fields without defaults become NULL, and required missing fields fail. For a dropped equality key, however, V1 errors for absent metadata while V2 silently synthesizes NULL and can retain a deleted row.
  • Coverage and observability: Existing tests cover the main same-version matrix, but not add-with-default -> equality delete -> schema-only drop or mixed-version scheduling. Debug metadata is useful and no logging/profile regression was found.
  • Persistence and FE/BE contract: This is read-only and adds no Doris persistent-state migration. Recursive FE-to-BE field/default metadata agrees for retained fields; the missing historical equality dependency is the contract hole.
  • Other/user focus: No additional user-provided focus and no other substantiated non-duplicate issue after two convergence rounds.

Comment thread be/test/format/table/iceberg/iceberg_reader_test.cpp Outdated
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17721	4022	3991	3991
q2	2041	330	206	206
q3	10318	1422	821	821
q4	4761	480	338	338
q5	8120	865	574	574
q6	313	172	133	133
q7	844	842	623	623
q8	10652	1562	1569	1562
q9	5999	4350	4300	4300
q10	6799	1780	1477	1477
q11	508	346	316	316
q12	762	580	455	455
q13	18170	3395	2812	2812
q14	265	267	247	247
q15	q16	792	777	714	714
q17	1024	1042	996	996
q18	6879	5805	5584	5584
q19	1167	1262	1058	1058
q20	789	695	640	640
q21	5535	2608	2378	2378
q22	438	361	296	296
Total cold run time: 103897 ms
Total hot run time: 29521 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4349	4242	4242	4242
q2	283	315	212	212
q3	4590	5004	4420	4420
q4	2060	2167	1353	1353
q5	4418	4249	4305	4249
q6	223	173	126	126
q7	2025	2077	1629	1629
q8	2534	2254	2179	2179
q9	8078	8055	7821	7821
q10	4678	4626	4277	4277
q11	577	400	415	400
q12	763	773	545	545
q13	3362	3634	3027	3027
q14	310	302	267	267
q15	q16	692	712	648	648
q17	1349	1336	1310	1310
q18	8063	7568	7220	7220
q19	1158	1117	1099	1099
q20	2232	2213	1959	1959
q21	5239	4596	4433	4433
q22	510	453	403	403
Total cold run time: 57493 ms
Total hot run time: 51819 ms

@hello-stephen

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

query5	4343	674	489	489
query6	482	246	217	217
query7	4843	578	332	332
query8	337	189	167	167
query9	8793	4017	4041	4017
query10	471	359	323	323
query11	5911	2361	2177	2177
query12	159	105	101	101
query13	1280	615	455	455
query14	6261	5178	4853	4853
query14_1	4255	4219	4209	4209
query15	212	204	182	182
query16	1086	497	447	447
query17	1129	739	580	580
query18	2581	484	369	369
query19	217	192	154	154
query20	114	111	109	109
query21	231	161	139	139
query22	13579	13749	13373	13373
query23	17470	16555	16256	16256
query23_1	16297	16213	16272	16213
query24	7579	1745	1270	1270
query24_1	1297	1299	1279	1279
query25	568	449	398	398
query26	1351	366	211	211
query27	2639	573	364	364
query28	4439	1956	1967	1956
query29	1099	623	496	496
query30	348	262	236	236
query31	1137	1096	980	980
query32	117	64	60	60
query33	542	326	259	259
query34	1180	1092	626	626
query35	772	802	681	681
query36	1233	1204	1070	1070
query37	153	112	95	95
query38	1916	1703	1658	1658
query39	887	871	826	826
query39_1	850	830	856	830
query40	250	171	142	142
query41	65	64	66	64
query42	95	92	97	92
query43	314	317	277	277
query44	1426	764	780	764
query45	196	187	175	175
query46	1066	1183	708	708
query47	2125	2114	1998	1998
query48	410	419	295	295
query49	573	416	307	307
query50	1066	436	325	325
query51	10775	10734	10730	10730
query52	86	88	78	78
query53	260	281	202	202
query54	278	245	224	224
query55	74	70	67	67
query56	313	317	274	274
query57	1319	1291	1206	1206
query58	291	261	254	254
query59	1523	1652	1441	1441
query60	301	274	249	249
query61	151	158	149	149
query62	536	494	431	431
query63	236	204	196	196
query64	2804	1057	848	848
query65	4728	4609	4619	4609
query66	1793	568	380	380
query67	28756	29236	29053	29053
query68	3300	1666	943	943
query69	422	306	272	272
query70	1051	930	939	930
query71	365	343	322	322
query72	3019	2678	2325	2325
query73	868	750	422	422
query74	5072	4909	4696	4696
query75	2531	2494	2138	2138
query76	2344	1172	783	783
query77	352	376	290	290
query78	11922	11817	11294	11294
query79	1439	1134	744	744
query80	1287	548	476	476
query81	521	336	289	289
query82	637	156	120	120
query83	366	327	301	301
query84	283	160	130	130
query85	956	614	514	514
query86	418	295	277	277
query87	1831	1830	1759	1759
query88	3714	2786	2793	2786
query89	433	368	329	329
query90	1961	202	194	194
query91	195	190	162	162
query92	65	60	61	60
query93	1652	1481	979	979
query94	727	344	322	322
query95	785	525	487	487
query96	1063	772	356	356
query97	2648	2634	2475	2475
query98	225	206	200	200
query99	1081	1120	973	973
Total cold run time: 263861 ms
Total hot run time: 177792 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.07
query3	0.26	0.14	0.14
query4	1.61	0.15	0.14
query5	0.25	0.24	0.22
query6	1.25	1.11	1.07
query7	0.04	0.01	0.01
query8	0.05	0.04	0.03
query9	0.40	0.31	0.31
query10	0.55	0.54	0.58
query11	0.19	0.15	0.14
query12	0.18	0.15	0.14
query13	0.48	0.47	0.48
query14	1.04	1.02	1.01
query15	0.61	0.60	0.60
query16	0.30	0.34	0.31
query17	1.16	1.12	1.09
query18	0.23	0.21	0.22
query19	2.04	1.94	1.96
query20	0.02	0.01	0.01
query21	15.44	0.23	0.14
query22	4.80	0.05	0.05
query23	16.13	0.33	0.13
query24	2.93	0.40	0.31
query25	0.11	0.05	0.04
query26	0.75	0.20	0.16
query27	0.05	0.04	0.04
query28	3.52	0.98	0.54
query29	12.50	4.19	3.30
query30	0.27	0.14	0.15
query31	2.78	0.58	0.31
query32	3.22	0.61	0.48
query33	3.29	3.25	3.21
query34	15.71	4.22	3.58
query35	3.48	3.54	3.59
query36	0.56	0.44	0.43
query37	0.09	0.06	0.06
query38	0.05	0.03	0.04
query39	0.03	0.04	0.03
query40	0.19	0.16	0.16
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 96.84 s
Total hot run time: 25.2 s

@hubgeter
hubgeter force-pushed the feature/iceberg-v3-defaults branch from e2687d3 to 77a962e Compare July 22, 2026 18:21
hubgeter added a commit to hubgeter/doris that referenced this pull request Jul 22, 2026
### What problem does this PR solve?

Issue Number: close apache#65806

Related PR: apache#65851

Problem Summary: Iceberg V3 distinguishes initial defaults used to read older files from write defaults used for new writes. Doris previously returned NULL for fields absent from a data file and did not propagate nested field defaults. This change carries Iceberg initial-default metadata through FE and Thrift, materializes missing primitive and complex values independently in File Scanner V1 and V2, preserves physical value and NULL precedence, and adds Spark-Iceberg generated coverage without expanding Doris Iceberg type mappings.

### Release note

Support reading Iceberg V3 initial defaults for missing primitive and nested fields in File Scanner V1 and V2.

### Check List (For Author)

- Test: Regression test / Unit Test
    - Regression test
    - Unit Test
- Behavior changed: Yes. Missing Iceberg fields now use their schema initial defaults; physically stored values and NULLs are unchanged.
- Does this need documentation: Yes. Design and rollout notes are included in this commit.
@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

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.

Requesting changes for two distinct equality-delete correctness regressions that can silently retain deleted rows.

Critical checkpoint conclusions

  • Goal and behavior: The current head now carries historical metadata and gates recursive initial-default semantics, addressing the three earlier review threads. Two supported schema-evolution paths remain incorrect: V1 loses a dropped delete key's stable field ID when a new field reuses its name, and FE infers history from numeric schema-ID order even though Iceberg defines schema IDs as unique identifiers and stores schemas as a metadata list (https://iceberg.apache.org/spec/#schema-evolution, https://iceberg.apache.org/spec/#table-metadata).
  • Scope and parallel paths: All 35 changed files and their relevant callers were reviewed. V1/V2, Parquet/ORC, ordinary and historical/ref selection, batch and non-batch delete planning, projected and hidden keys, name and field-ID mapping, and FE/BE carrier construction were checked. The V1 issue exists in both Parquet and ORC; the history-order issue reaches Doris's V2 direct-name fallback for ID-less files without an authoritative name mapping. With an explicit schema.name-mapping.default, Iceberg's projection rule is authoritative and the stale carrier name does not cause this example (https://iceberg.apache.org/spec/#column-projection).
  • Concurrency and lifecycle: Reader-local mapping/default state, expression prepare/open/close behavior, split/block reuse, async batch delete planning, and cleanup paths were inspected. No additional concurrency, ownership, or lifecycle defect was substantiated.
  • Configuration and upgrade compatibility: No configuration-default change was introduced. The additive Thrift fields and explicit scan-semantics capability gate address the already-raised rolling-upgrade concern; no separate current-head mixed-version issue was found.
  • Conditionals and error propagation: Physical values and NULLs take precedence over defaults, missing optional fields can materialize defaults/NULL, and malformed unsupported values return errors. The two inline cases bypass the intended stable-ID semantics and silently produce a nonmatching delete value, which is why they are blocking.
  • Tests and validation: The changed regression/unit coverage exercises retained fields, nested values, immutable initial defaults, binary-like encodings, and V1/V2 Parquet/ORC. It does not cover drop/re-add with the same name in V1 or non-monotonic schema IDs with rename/delete/drop in the no-mapping direct-name fallback. Static review only: the governing task prohibited local builds and test execution. At the final check, formatter, checkstyle, secret, license, and dependency checks were successful; BE/FE/Cloud/compile/performance and macOS jobs were still pending.
  • Persistence, transactions, and data writes: This is a read-path change with no Doris metadata migration, transaction-boundary change, or new data-writing behavior. Snapshot/ref schema pinning and MVCC selection showed no separate issue.
  • API/protocol and compatibility: Field IDs remain the required identity boundary. The FE-to-BE carrier is additive and source-compatible, but both inline bugs violate the Iceberg schema/equality-delete contract within the new behavior.
  • Performance and observability: Historical metadata construction and typed constant expansion add bounded per-scan/per-reader work; no additional blocking asymptotic or profiling/logging regression was substantiated. Existing errors remain visible, while the two reported paths are especially serious because they return wrong rows without an error.
  • Other and user focus: No user-provided focus points were present. The full changed-file sweep, refreshed live-comment deduplication, and independent convergence passes found no other valuable nonduplicate findings.

Comment thread be/src/format/table/iceberg_reader.cpp Outdated
@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.62% (1908/2458)
Line Coverage 64.47% (34149/52968)
Region Coverage 64.92% (17577/27076)
Branch Coverage 54.09% (9424/17424)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17700	4033	4044	4033
q2	2004	315	203	203
q3	10783	1415	818	818
q4	4750	473	342	342
q5	8314	841	556	556
q6	319	171	138	138
q7	847	835	632	632
q8	10623	1438	1454	1438
q9	5820	4320	4349	4320
q10	6804	1748	1445	1445
q11	524	351	313	313
q12	730	571	455	455
q13	18098	3318	2754	2754
q14	269	257	252	252
q15	q16	789	766	705	705
q17	949	912	857	857
q18	6979	5734	5578	5578
q19	1589	1183	1066	1066
q20	797	716	587	587
q21	5660	2579	2461	2461
q22	431	358	300	300
Total cold run time: 104779 ms
Total hot run time: 29253 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4448	4270	4368	4270
q2	290	318	217	217
q3	4559	5002	4433	4433
q4	2071	2146	1361	1361
q5	4380	4239	4305	4239
q6	226	178	130	130
q7	2112	1896	1608	1608
q8	2552	2128	2160	2128
q9	7899	7846	7685	7685
q10	4712	4670	4197	4197
q11	602	514	396	396
q12	751	774	540	540
q13	3368	3681	2992	2992
q14	300	314	273	273
q15	q16	695	751	652	652
q17	1317	1318	1343	1318
q18	8025	7449	7002	7002
q19	1089	1059	1051	1051
q20	2226	2214	1951	1951
q21	5302	4586	4483	4483
q22	506	453	405	405
Total cold run time: 57430 ms
Total hot run time: 51331 ms

@hello-stephen

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

query5	4339	630	495	495
query6	456	241	202	202
query7	4838	588	352	352
query8	344	188	188	188
query9	8786	4117	4084	4084
query10	458	346	289	289
query11	5828	2333	2138	2138
query12	150	103	102	102
query13	1279	622	384	384
query14	6258	5204	5102	5102
query14_1	4282	4264	4326	4264
query15	205	199	173	173
query16	1051	458	439	439
query17	1098	693	557	557
query18	2422	452	338	338
query19	202	181	141	141
query20	109	109	106	106
query21	229	161	137	137
query22	13615	13547	13332	13332
query23	17331	16442	16011	16011
query23_1	16230	16251	16216	16216
query24	7447	1714	1257	1257
query24_1	1295	1253	1256	1253
query25	535	437	363	363
query26	1370	362	201	201
query27	2576	608	377	377
query28	4527	2000	1994	1994
query29	1066	613	486	486
query30	344	269	226	226
query31	1118	1114	993	993
query32	110	67	64	64
query33	522	330	261	261
query34	1200	1094	632	632
query35	782	769	671	671
query36	1161	1172	1049	1049
query37	148	104	96	96
query38	1873	1706	1670	1670
query39	874	873	834	834
query39_1	814	845	848	845
query40	255	164	138	138
query41	65	66	68	66
query42	93	101	97	97
query43	321	326	280	280
query44	1387	770	757	757
query45	203	184	173	173
query46	1046	1155	768	768
query47	2120	2102	1929	1929
query48	389	410	298	298
query49	579	414	297	297
query50	1006	442	338	338
query51	10925	10572	10547	10547
query52	84	87	74	74
query53	260	280	198	198
query54	274	235	223	223
query55	73	70	64	64
query56	296	280	296	280
query57	1306	1291	1194	1194
query58	290	254	254	254
query59	1592	1662	1498	1498
query60	300	273	251	251
query61	151	155	149	149
query62	537	495	441	441
query63	236	205	206	205
query64	2805	1074	865	865
query65	4741	4619	4595	4595
query66	1819	506	373	373
query67	29346	29238	29055	29055
query68	3216	1588	966	966
query69	398	297	276	276
query70	1023	961	967	961
query71	366	327	323	323
query72	3034	2686	2456	2456
query73	841	783	458	458
query74	5097	4929	4723	4723
query75	2549	2503	2153	2153
query76	2323	1149	789	789
query77	364	384	292	292
query78	11933	11978	11287	11287
query79	1216	1158	740	740
query80	619	573	497	497
query81	450	344	302	302
query82	240	159	123	123
query83	325	334	313	313
query84	291	166	139	139
query85	969	685	600	600
query86	314	285	300	285
query87	1815	1818	1747	1747
query88	3663	2856	2743	2743
query89	417	378	323	323
query90	2168	195	195	195
query91	196	187	163	163
query92	60	60	53	53
query93	1485	1523	1065	1065
query94	534	339	307	307
query95	783	506	556	506
query96	1072	806	340	340
query97	2604	2615	2512	2512
query98	210	209	202	202
query99	1070	1096	965	965
Total cold run time: 261764 ms
Total hot run time: 177624 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.14	0.08	0.08
query3	0.37	0.24	0.25
query4	1.61	0.24	0.25
query5	0.33	0.31	0.32
query6	1.16	0.67	0.67
query7	0.03	0.00	0.00
query8	0.09	0.07	0.07
query9	0.51	0.40	0.38
query10	0.58	0.59	0.61
query11	0.30	0.18	0.18
query12	0.32	0.19	0.18
query13	0.54	0.53	0.52
query14	0.94	0.92	0.93
query15	0.68	0.60	0.60
query16	0.39	0.38	0.38
query17	1.04	1.01	1.03
query18	0.31	0.29	0.30
query19	1.97	1.79	1.81
query20	0.02	0.02	0.01
query21	15.41	0.38	0.31
query22	4.80	0.13	0.14
query23	15.81	0.49	0.31
query24	2.34	0.63	0.42
query25	0.16	0.11	0.10
query26	0.74	0.27	0.22
query27	0.10	0.09	0.10
query28	3.43	0.88	0.51
query29	12.48	4.25	3.35
query30	0.36	0.26	0.26
query31	2.77	0.62	0.33
query32	3.24	0.60	0.47
query33	2.91	3.02	2.97
query34	15.82	4.09	3.38
query35	3.32	3.29	3.30
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.07	0.06
query40	0.21	0.17	0.18
query41	0.13	0.09	0.08
query42	0.09	0.06	0.06
query43	0.08	0.07	0.07
Total cold run time: 96.47 s
Total hot run time: 25.7 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 79.87% (119/149) 🎉
Increment coverage report
Complete coverage report

hubgeter added a commit to hubgeter/doris that referenced this pull request Jul 22, 2026
### What problem does this PR solve?

Issue Number: close apache#65806

Related PR: apache#65851

Problem Summary: Iceberg V3 distinguishes initial defaults used to read older files from write defaults used for new writes. Doris previously returned NULL for fields absent from a data file and did not propagate nested field defaults. This change carries Iceberg initial-default metadata through FE and Thrift, materializes missing primitive and complex values independently in File Scanner V1 and V2, preserves physical value and NULL precedence, and adds Spark-Iceberg generated coverage without expanding Doris Iceberg type mappings.

### Release note

Support reading Iceberg V3 initial defaults for missing primitive and nested fields in File Scanner V1 and V2.

### Check List (For Author)

- Test: Regression test / Unit Test
    - Regression test
    - Unit Test
- Behavior changed: Yes. Missing Iceberg fields now use their schema initial defaults; physically stored values and NULLs are unchanged.
- Does this need documentation: Yes. Design and rollout notes are included in this commit.
@hubgeter
hubgeter force-pushed the feature/iceberg-v3-defaults branch from 77a962e to 68e53f0 Compare July 22, 2026 21:07
@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

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.

Requesting changes for three distinct current-head issues: one V2 equality-delete correctness gap and two rolling-upgrade compatibility regressions. The detailed scenarios and fix directions are attached inline.

Critical checkpoint conclusions

  • Goal and proof: the PR broadly implements Iceberg V3 initial defaults across FE, V1/V2 Parquet and ORC, and equality deletes, with substantial unit and regression coverage; M1 and M2 show that the goal is not yet met for expired lineage and mixed-version execution, while M3 exposes an availability regression in the compatibility fix.
  • Scope, clarity, and reuse: the production changes are cohesive and mostly reuse the existing schema mapper, expression, and scanner abstractions. The remaining history and capability decisions are not safely bounded.
  • Concurrency: batch split planning is asynchronous, but the scan params/carrier are shared before BE execution and the checked backend collection is the same one used by batch and non-batch assignment. No new data race, lock-order, or blocking-under-lock issue was found.
  • Lifecycle and memory/nullability: V1 prepared defaults and V2 mapping expressions are reader/file scoped, opened and reset consistently; variable-width defaults are materialized into owning columns; parent NULL and physical NULL precedence are preserved. No separate lifecycle or ownership issue was found.
  • Configuration: no production configuration item was added.
  • Compatibility: the additive Thrift fields are wire-compatible, but semantic mixed-version behavior is not: M2 lacks a capability/version boundary, and M3 rejects pruned queries that do not need new BE behavior.
  • Parallel paths and conditionals: V1 Parquet/ORC, V2, BY_FIELD_ID/BY_NAME, batch/non-batch, current/time-travel/branch paths, and required/optional/default-vs-physical-NULL cases were traced. M1 is the V2-only hole in a fallback already present in both V1 formats.
  • Tests and results: the PR adds FE, V1, V2, fixture, and four scanner/format regression lanes with deterministic ordered output, but no test covers M1-M3. Per the governing review prompt, no local build or test was run; .worktree_initialized, thirdparty/installed, and protoc are absent. At review time style, secret, license, dependency, and large-file checks passed, while compile and unit/performance jobs were still pending.
  • Observability: parser and required-field failures propagate with status; no additional metric/logging requirement was identified for this read path.
  • Transactions, persistence, and writes: production changes are read-path/schema-carrier changes only; no EditLog, transaction, or storage-write protocol is involved.
  • FE/BE variables: recursive field metadata, optionality, binary markers, and serialized defaults are carried consistently and the two BE parsers agree; the missing rollout capability in M2 is the outstanding transport/version concern.
  • Performance: defaults are parsed/prepared at mapping/reader boundaries rather than per row, and no new hot-loop allocation or material performance issue was found.
  • Other issues and user focus: all five earlier inline threads were treated as known context and not duplicated. There was no additional user-provided review focus, and the final 35-file sweep found no fourth substantiated issue.

Validation was static-only as required by the review prompt.

@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.62% (1908/2458)
Line Coverage 64.47% (34150/52968)
Region Coverage 64.87% (17564/27076)
Branch Coverage 54.04% (9416/17424)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17655	4006	4058	4006
q2	2005	331	198	198
q3	10848	1434	835	835
q4	4735	474	343	343
q5	8177	832	579	579
q6	301	174	139	139
q7	805	853	615	615
q8	10706	1562	1523	1523
q9	5780	4360	4309	4309
q10	6805	1752	1454	1454
q11	513	351	321	321
q12	737	582	448	448
q13	18118	3345	2748	2748
q14	275	266	246	246
q15	q16	784	778	709	709
q17	1092	925	956	925
q18	7060	5918	5569	5569
q19	1704	1285	1092	1092
q20	857	690	607	607
q21	5900	2569	2468	2468
q22	425	348	298	298
Total cold run time: 105282 ms
Total hot run time: 29432 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4412	4330	4315	4315
q2	294	312	211	211
q3	4553	4997	4384	4384
q4	2051	2140	1360	1360
q5	4385	4268	4275	4268
q6	231	178	219	178
q7	2173	1846	1594	1594
q8	2516	2109	2118	2109
q9	7832	7649	7766	7649
q10	4707	4607	4206	4206
q11	666	414	376	376
q12	769	760	541	541
q13	3272	3579	2964	2964
q14	289	314	273	273
q15	q16	701	751	658	658
q17	1339	1322	1324	1322
q18	8335	7436	7002	7002
q19	1116	1138	1086	1086
q20	2237	2222	1934	1934
q21	5214	4532	4359	4359
q22	515	447	410	410
Total cold run time: 57607 ms
Total hot run time: 51199 ms

@hello-stephen

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

query5	4318	629	476	476
query6	458	219	203	203
query7	4844	573	337	337
query8	346	194	169	169
query9	8755	4123	4034	4034
query10	457	373	307	307
query11	5881	2339	2164	2164
query12	164	102	103	102
query13	1265	629	427	427
query14	6170	5187	4900	4900
query14_1	4226	4238	4220	4220
query15	216	206	181	181
query16	1017	451	477	451
query17	1137	725	576	576
query18	2580	477	358	358
query19	211	194	153	153
query20	112	108	106	106
query21	245	165	138	138
query22	13604	13526	13345	13345
query23	17374	16439	16058	16058
query23_1	16150	16145	16284	16145
query24	7695	1767	1282	1282
query24_1	1308	1295	1288	1288
query25	568	458	389	389
query26	1328	360	210	210
query27	2573	618	391	391
query28	4452	1982	1995	1982
query29	1101	619	490	490
query30	340	266	232	232
query31	1130	1104	978	978
query32	113	74	68	68
query33	528	338	261	261
query34	1188	1180	655	655
query35	778	794	673	673
query36	1216	1186	1073	1073
query37	153	107	95	95
query38	1866	1708	1655	1655
query39	883	857	845	845
query39_1	831	829	865	829
query40	296	162	141	141
query41	66	63	63	63
query42	91	91	88	88
query43	319	325	278	278
query44	1422	768	758	758
query45	196	183	174	174
query46	1057	1180	696	696
query47	2103	2109	1961	1961
query48	401	409	290	290
query49	580	429	304	304
query50	1042	429	341	341
query51	10856	10602	10624	10602
query52	87	91	76	76
query53	264	273	202	202
query54	282	247	226	226
query55	73	71	69	69
query56	300	304	300	300
query57	1324	1283	1190	1190
query58	293	281	250	250
query59	1569	1621	1456	1456
query60	307	276	261	261
query61	157	153	157	153
query62	541	500	429	429
query63	239	203	201	201
query64	2798	1033	911	911
query65	4711	4658	4645	4645
query66	1799	495	386	386
query67	29495	29195	29011	29011
query68	3054	1468	1018	1018
query69	409	300	269	269
query70	1041	953	959	953
query71	396	343	328	328
query72	3242	2628	2388	2388
query73	811	793	457	457
query74	5043	4902	4750	4750
query75	2525	2511	2137	2137
query76	2353	1165	721	721
query77	356	371	284	284
query78	11824	11810	11157	11157
query79	1398	1124	751	751
query80	1298	550	478	478
query81	516	336	288	288
query82	643	153	118	118
query83	370	330	315	315
query84	286	160	130	130
query85	981	621	552	552
query86	429	294	276	276
query87	1841	1818	1751	1751
query88	3618	2737	2774	2737
query89	430	382	337	337
query90	1892	201	198	198
query91	204	192	163	163
query92	60	61	55	55
query93	1633	1513	964	964
query94	723	314	313	313
query95	806	549	472	472
query96	1028	780	361	361
query97	2654	2619	2487	2487
query98	212	205	200	200
query99	1098	1094	973	973
Total cold run time: 263670 ms
Total hot run time: 177423 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.15	0.09	0.09
query3	0.38	0.25	0.24
query4	1.60	0.24	0.25
query5	0.33	0.32	0.32
query6	1.16	0.68	0.69
query7	0.04	0.01	0.01
query8	0.09	0.08	0.08
query9	0.52	0.39	0.38
query10	0.63	0.60	0.59
query11	0.31	0.17	0.18
query12	0.31	0.18	0.19
query13	0.54	0.55	0.53
query14	0.94	0.95	0.95
query15	0.68	0.61	0.59
query16	0.40	0.40	0.40
query17	1.02	1.06	1.02
query18	0.32	0.32	0.31
query19	1.94	1.82	1.81
query20	0.02	0.01	0.02
query21	15.41	0.39	0.32
query22	4.84	0.14	0.14
query23	15.83	0.49	0.31
query24	2.42	0.60	0.43
query25	0.15	0.10	0.09
query26	0.73	0.26	0.21
query27	0.09	0.10	0.09
query28	3.40	0.91	0.54
query29	12.48	4.25	3.34
query30	0.36	0.26	0.26
query31	2.77	0.66	0.35
query32	3.23	0.65	0.49
query33	3.05	3.00	3.11
query34	15.84	4.11	3.44
query35	3.35	3.34	3.32
query36	0.65	0.55	0.51
query37	0.12	0.10	0.10
query38	0.08	0.07	0.07
query39	0.07	0.06	0.06
query40	0.20	0.18	0.16
query41	0.13	0.08	0.08
query42	0.09	0.05	0.06
query43	0.08	0.07	0.07
Total cold run time: 96.75 s
Total hot run time: 26.03 s

hubgeter added a commit to hubgeter/doris that referenced this pull request Jul 23, 2026
### What problem does this PR solve?

Issue Number: close apache#65806

Related PR: apache#65851

Problem Summary: Iceberg V3 distinguishes initial defaults used to read older files from write defaults used for new writes. Doris previously returned NULL for fields absent from a data file and did not propagate nested field defaults. This change carries Iceberg initial-default metadata through FE and Thrift, materializes missing primitive and complex values independently in File Scanner V1 and V2, preserves physical value and NULL precedence, and adds Spark-Iceberg generated coverage without expanding Doris Iceberg type mappings.

### Release note

Support reading Iceberg V3 initial defaults for missing primitive and nested fields in File Scanner V1 and V2.

### Check List (For Author)

- Test: Regression test / Unit Test
    - Regression test
    - Unit Test
- Behavior changed: Yes. Missing Iceberg fields now use their schema initial defaults; physically stored values and NULLs are unchanged.
- Does this need documentation: Yes. Design and rollout notes are included in this commit.
@hubgeter

hubgeter commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

hubgeter commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17412	4080	4006	4006
q2	2018	328	199	199
q3	10203	1434	793	793
q4	4674	470	349	349
q5	7509	839	564	564
q6	185	174	138	138
q7	755	795	589	589
q8	9375	1434	1487	1434
q9	5289	4058	3993	3993
q10	6743	1669	1369	1369
q11	511	354	328	328
q12	719	596	455	455
q13	18106	3247	2737	2737
q14	261	258	247	247
q15	q16	726	736	658	658
q17	1038	960	1008	960
q18	6980	5745	5583	5583
q19	1648	1310	1082	1082
q20	807	678	565	565
q21	5838	2645	2365	2365
q22	437	355	298	298
Total cold run time: 101234 ms
Total hot run time: 28712 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4374	4253	4247	4247
q2	271	315	208	208
q3	4537	4922	4378	4378
q4	2171	2316	1404	1404
q5	4243	4112	4142	4112
q6	234	178	128	128
q7	1725	1616	1417	1417
q8	2967	2197	2140	2140
q9	7542	7425	7564	7425
q10	4297	4317	3923	3923
q11	573	424	369	369
q12	715	723	521	521
q13	3238	3516	2826	2826
q14	317	311	280	280
q15	q16	708	718	616	616
q17	1294	1290	1261	1261
q18	7919	7196	7090	7090
q19	1201	1149	1167	1149
q20	2215	2224	1940	1940
q21	5256	4590	4451	4451
q22	517	460	417	417
Total cold run time: 56314 ms
Total hot run time: 50302 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.

Request changes: three new P1 correctness issues remain on the current head: V2 can abort on a wholly absent nested-key root, branch writes analyze the wrong schema, and V1 Parquet can ignore a usable descendant field ID. Details and fix directions are inline.

Critical checkpoint conclusions:

  • Goal and behavior: The PR broadly implements Iceberg V3 initial/write defaults, recursive reads, equality-delete evolution, and pinned write metadata across FE and both BE reader stacks. The three inline cases leave valid branch writes incompatible with Iceberg/Spark, crash one V2 evolution path, or silently misapply a V1 equality delete.
  • Scope and parallel paths: All 78 authoritative changed paths were reviewed. V1/V2, Parquet/ORC, current/ref/history schemas, projected and hidden fields, INSERT/OVERWRITE/UPDATE/MERGE, batch/non-batch planning, and commit replay were traced. No fourth non-duplicate issue survived the final sweep.
  • Conditions and error handling: Required/optional checks, physical NULL precedence, recursive defaults, and commit validation generally fail or propagate correctly. MAIN-F1 reaches a hard check through an unmaterialized constant, while MAIN-F3 selects the wrong identity mode and can return wrong rows instead of failing.
  • Lifecycle and concurrency: Reader-local expressions/defaults, statement-scoped writer contexts, async planning state, transaction refresh, and final metadata CAS have bounded ownership and consistent cleanup. No additional race, lock-order, lifetime, or commit-bypass defect was substantiated.
  • Compatibility and FE/BE propagation: The semantics marker and additive Thrift metadata cover the inspected mixed-version paths. MAIN-F2 is instead an engine interoperability regression: branch writes no longer use the branch-head schema exposed by Iceberg 1.10.1 Spark and by Doris branch reads.
  • Tests and validation: The changed FE, BE, fixture, and regression coverage is broad and deterministic where applicable, but it omits wholly absent complex equality roots, ID-less Parquet roots with ID-bearing renamed children, and the restored branch-head interoperability contract. Static review only: the governing prompt prohibited builds and test execution.
  • Performance and observability: Default materialization and schema-history work are bounded at scan/reader scope. The remaining all-column ORC normalization cost is already covered by a live thread; no new performance or observability issue was found.
  • Persistence, transactions, configuration, and docs: No Doris EditLog migration or new configuration item is introduced. Iceberg remains the atomic commit boundary and the current validation wrapper closes the checked replay races. Documentation is extensive, but the branch regression now contradicts the previously documented Spark-aligned behavior.
  • Existing discussion and focus: The live historical-carrier, backslash, plugin-TCCL, and ORC-cost findings were treated as duplicates and not repeated. No additional review focus was supplied, so the whole PR was reviewed.


std::vector<const NullMap*> ancestor_null_maps;
for (const size_t child_index : _child_indexes) {
if (const auto* nullable = check_and_get_column<ColumnNullable>(*current);

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.

[P1] Materialize missing struct defaults before nested lookup

When the whole top-level struct is absent from an old data file, data_path is empty and missing_root_expr is a VLiteral. VLiteral returns a ColumnConst, but this loop tests it directly as ColumnNullable/ColumnStruct; the nullable check misses the wrapper and the following DORIS_CHECK(struct_column != nullptr) aborts. This is reachable for an added optional payload STRUCT<k INT> followed by an equality delete on payload.k, for both a NULL struct and a non-NULL complex initial default. Existing tests cover only a physically present parent with a missing child. Please materialize current before traversing it and add forced V2 Parquet/ORC coverage where the entire struct is absent.

Objects.requireNonNull(branchName, "branchName should not be null");
// Iceberg schema evolution is table-global. A branch selects the snapshot lineage that receives
// the commit, while files written by that commit use the table's current schema.
Schema schema = table.schema();

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.

[P1] Keep branch writes on the branch-head schema

This always pins table.schema(), but Iceberg 1.10.1's Spark connector exposes SnapshotUtil.schemaFor(table, branch) as the target table schema, and Doris branch reads do the same. If branch b is still on schema A after main advances to B, Doris now rejects valid A-shaped writes and accepts B-only columns/defaults that Spark does not expose for that branch. The regression was flipped to enforce this divergence even though the earlier current-schema request was explicitly withdrawn after the Spark contract was checked. Please restore branch-head schema resolution and keep the current-schema compatibility checks at commit time.

}
const bool use_field_ids_for_hidden_keys =
supports_iceberg_scan_semantics_v1(&get_scan_params())
? any_file_column_has_field_id

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.

[P1] Detect descendant IDs before choosing hidden-key mapping

This mode flag inspects only top-level Parquet fields. With an ID-less payload wrapper whose renamed child still has field ID 2, ordinary projection enters ID mode via parquet_subtree_has_field_id() and correctly binds the wrapper through that descendant, but the equality-key path enters name mode. It then misses the old child name (or an authoritative empty name mapping) and synthesizes NULL/default instead of reading the physical key, so an applicable equality delete is missed or the scan rejects a required field. Please make the hidden-key decision recursive like BuildTableInfoUtil and add a V1 Parquet equality-delete test with an ID-less root and renamed ID-bearing child.

@hello-stephen

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

query5	4314	609	460	460
query6	459	216	194	194
query7	4876	606	349	349
query8	333	175	163	163
query9	8786	4072	4060	4060
query10	478	344	299	299
query11	5735	2234	2005	2005
query12	150	95	100	95
query13	1256	611	433	433
query14	6077	4710	4399	4399
query14_1	3790	3785	3812	3785
query15	221	200	174	174
query16	1038	484	457	457
query17	1139	742	528	528
query18	2544	474	337	337
query19	200	192	147	147
query20	106	108	95	95
query21	233	157	139	139
query22	12963	12990	12745	12745
query23	17303	16406	16076	16076
query23_1	16242	16122	16138	16122
query24	7449	1696	1222	1222
query24_1	1275	1271	1228	1228
query25	524	421	357	357
query26	1323	359	205	205
query27	2554	577	392	392
query28	4389	2026	2049	2026
query29	1095	652	478	478
query30	349	259	232	232
query31	1117	1083	971	971
query32	108	61	59	59
query33	520	302	235	235
query34	1181	1092	631	631
query35	761	753	643	643
query36	766	795	720	720
query37	153	103	96	96
query38	1825	1669	1594	1594
query39	824	820	789	789
query39_1	795	792	782	782
query40	251	167	143	143
query41	65	63	63	63
query42	97	90	96	90
query43	318	312	278	278
query44	1456	798	757	757
query45	191	174	162	162
query46	1034	1197	719	719
query47	1516	1486	1430	1430
query48	411	388	298	298
query49	583	436	301	301
query50	1086	432	346	346
query51	10643	10520	10293	10293
query52	83	85	73	73
query53	259	277	194	194
query54	269	243	221	221
query55	73	72	65	65
query56	323	293	279	279
query57	1030	999	917	917
query58	281	272	249	249
query59	1541	1618	1376	1376
query60	305	265	258	258
query61	172	170	174	170
query62	408	332	294	294
query63	249	202	209	202
query64	2945	1160	946	946
query65	3910	3798	3888	3798
query66	1838	477	375	375
query67	28166	28275	28058	28058
query68	3251	1506	982	982
query69	431	315	279	279
query70	882	776	796	776
query71	394	331	325	325
query72	3160	2707	2327	2327
query73	842	744	425	425
query74	4632	4523	4278	4278
query75	2411	2328	1994	1994
query76	2255	1148	789	789
query77	347	375	280	280
query78	11240	11058	10681	10681
query79	1383	1135	757	757
query80	1289	555	456	456
query81	508	333	288	288
query82	609	152	117	117
query83	372	324	302	302
query84	273	159	129	129
query85	1008	618	511	511
query86	394	240	232	232
query87	1786	1789	1739	1739
query88	3745	2810	2806	2806
query89	394	331	284	284
query90	1868	201	194	194
query91	197	193	174	174
query92	66	60	55	55
query93	1559	1548	959	959
query94	696	367	294	294
query95	807	510	561	510
query96	1057	792	335	335
query97	2491	2465	2359	2359
query98	201	224	193	193
query99	723	726	607	607
Total cold run time: 256081 ms
Total hot run time: 169320 ms

@hello-stephen

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

query1	0.01	0.00	0.00
query2	0.10	0.05	0.04
query3	0.25	0.14	0.13
query4	1.60	0.14	0.14
query5	0.23	0.23	0.22
query6	1.16	0.80	0.82
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.37	0.31	0.31
query10	0.54	0.58	0.53
query11	0.20	0.14	0.13
query12	0.19	0.15	0.14
query13	0.47	0.47	0.47
query14	1.01	1.00	1.02
query15	0.61	0.57	0.57
query16	0.33	0.34	0.31
query17	1.06	1.07	1.08
query18	0.20	0.19	0.20
query19	2.09	1.88	1.98
query20	0.02	0.01	0.01
query21	15.41	0.21	0.13
query22	4.84	0.06	0.06
query23	16.12	0.32	0.12
query24	2.96	0.41	0.33
query25	0.12	0.04	0.04
query26	0.73	0.20	0.15
query27	0.04	0.04	0.04
query28	3.58	0.79	0.35
query29	12.52	4.13	3.26
query30	0.28	0.15	0.15
query31	2.77	0.56	0.31
query32	3.22	0.59	0.49
query33	3.24	3.18	3.17
query34	15.48	3.99	3.30
query35	3.24	3.21	3.25
query36	0.55	0.45	0.40
query37	0.09	0.06	0.07
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.14 s
Total hot run time: 23.86 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 83.17% (2219/2668) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.23% (25718/43420)
Line Coverage 43.39% (259077/597039)
Region Coverage 39.10% (205712/526122)
Branch Coverage 40.45% (94016/232450)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 83.35% (2223/2667) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.83% (32114/42351)
Line Coverage 60.56% (359137/593063)
Region Coverage 57.07% (301286/527889)
Branch Coverage 58.59% (136205/232488)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 15.05% (28/186) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: apache#65851

Problem Summary: Missing whole-struct defaults remained const during nested equality-delete lookup, V1 Parquet hidden keys ignored descendant field IDs, and branch writes used the table current schema instead of the branch-head schema. Materialize nested default literals while retaining nullable ancestor ownership, align hidden-key ID detection with recursive schema matching, and restore branch snapshot schema pinning with current-schema compatibility validation.

### Release note

Fix schema-evolved Iceberg branch writes and nested equality-delete reads.

### Check List (For Author)

- Test:
    - Unit Test: IcebergWritePlanProviderTest (46 tests); IcebergV2ReaderTest.IcebergMissingWholeStructEqualityKeyMaterializesDefault; IcebergReaderTest.v1_parquet_uses_descendant_id_for_hidden_nested_equality_key
    - Regression test: Not run locally because it requires an external Iceberg environment; restored the branch-head schema scenario and kept its generated output unchanged
    - Static check: build-support/check-format.sh passed; build-support/run-clang-tidy.sh was attempted but is blocked by existing toolchain and repository diagnostics, including missing stddef.h and an unmatched NOLINTEND
- Behavior changed: Yes. Branch-targeted writes bind to the branch-head schema, and nested equality deletes resolve evolved defaults and descendant IDs correctly.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65851

Problem Summary: Bring the PR branch through apache/master at 6ee10af and resolve the ExecuteCommandTest conflict by preserving both the prepared connector schema refresh coverage and master MVCC and scan-option reset coverage.

### Release note

None

### Check List (For Author)

- Test:
    - Unit Test: IcebergWritePlanProviderTest (46 tests); ExecuteCommandTest (7 tests)
    - BE Unit Test: Not run for this intermediate merge; the final head will be validated after incorporating the latest apache/master
    - Static check: PR-specific diff check passed; the merge imports pre-existing whitespace diagnostics from apache/master regression outputs
- Behavior changed: No. This merge preserves both branch and master behavior.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close apache#65851

Related PR: apache#65851

Problem Summary: Bring the branch up to the latest apache/master at d14c6b9. The two new upstream changes are unrelated to the Iceberg V3 default-value implementation and merged without conflicts.

### Release note

None

### Check List (For Author)

- Test: Final validation is pending on the fully merged tree
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: None

Related PR: apache#65851

Problem Summary: The latest review fixes lacked direct assertions for the surviving rows in the V1 descendant field-ID equality-delete case and for branch schema compatibility when current required fields differ from the pinned branch schema. Assert the exact retained row IDs and cover incompatible required additions, concurrent optional-to-required evolution, and compatible required additions with initial defaults.

### Release note

None

### Check List (For Author)

- Test:
    - Unit Test: Not run after this change because local UT compilation was explicitly stopped
    - Static check: git diff --check and build-support/check-format.sh passed
- Behavior changed: No
- Does this need documentation: No
@hubgeter

hubgeter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

hubgeter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review context preparation failed before Codex ran; inspect the 'Prepare authoritative PR context and required AGENTS guides' step.
Workflow run: https://github.com/apache/doris/actions/runs/30796767539

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

table.newAppend().commit();
table.manageSnapshots().createBranch("old_schema", table.currentSnapshot().snapshotId()).commit();
table.updateSchema().addRequiredColumn(
"required_value", Types.IntegerType.get(), Literal.of(7)).commit();

@Gabriel39 Gabriel39 Aug 3, 2026

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.

[P1] Create a format-v3 table before adding this initial default

unpartitionedUnsortedTable(catalog) creates the table with the default format version (v2), but Iceberg permits a non-null initial default only in v3. As a result, this test fails at this commit() before it exercises validateCurrentSchema():

Tests run: 1, Failures: 0, Errors: 1
Invalid schema for v2:
- Invalid initial default for required_value: non-null default (7) is not supported until v3

I reproduced this with IcebergWritePlanProviderTest#branchWriteAllowsCurrentRequiredFieldWithInitialDefault on the current head. Please create or upgrade this fixture as format v3 (the existing formatVersionThreeTable helper demonstrates the required property), then rerun the test so it validates the intended branch-compatibility behavior.

### What problem does this PR solve?

Issue Number: None

Related PR: apache#65851

Problem Summary: The branch compatibility test attempted to add a non-null initial default to a format-v2 Iceberg table, so Iceberg rejected the schema update before the intended validation path ran. Reuse the existing format-v3 table fixture and its matching table name so the test reaches and verifies branch schema compatibility.

### Release note

None

### Check List (For Author)

- Test:
    - Unit Test: Not run because local UT compilation remains explicitly disabled
    - Static check: git diff --check passed
- Behavior changed: No
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 43.55% (81/186) 🎉
Increment coverage report
Complete coverage report

@hubgeter

hubgeter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

hubgeter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17641	4008	4011	4008
q2	2020	349	203	203
q3	10246	1453	830	830
q4	4681	475	344	344
q5	7602	903	576	576
q6	185	179	139	139
q7	778	804	605	605
q8	9338	1642	1577	1577
q9	5436	4121	4058	4058
q10	6741	1655	1368	1368
q11	514	350	326	326
q12	768	599	462	462
q13	18211	3414	2704	2704
q14	264	262	238	238
q15	q16	750	731	662	662
q17	964	988	929	929
q18	7136	5744	5514	5514
q19	1382	1203	1117	1117
q20	798	725	577	577
q21	6002	2647	2490	2490
q22	455	355	293	293
Total cold run time: 101912 ms
Total hot run time: 29020 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4399	4226	4360	4226
q2	311	320	210	210
q3	4513	4946	4403	4403
q4	2204	2309	1431	1431
q5	4307	4180	4209	4180
q6	241	179	131	131
q7	1685	1614	1942	1614
q8	2689	2185	2314	2185
q9	7422	7691	7402	7402
q10	4355	4420	3944	3944
q11	568	435	392	392
q12	749	740	522	522
q13	3302	3545	2907	2907
q14	295	311	287	287
q15	q16	714	721	634	634
q17	1353	1362	1326	1326
q18	8011	7242	7271	7242
q19	1228	1199	1160	1160
q20	2217	2203	1915	1915
q21	5389	4702	4560	4560
q22	524	446	402	402
Total cold run time: 56476 ms
Total hot run time: 51073 ms

@hello-stephen

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

query5	4313	618	488	488
query6	465	228	218	218
query7	4870	613	344	344
query8	348	189	167	167
query9	8782	4104	4110	4104
query10	474	367	334	334
query11	5685	2195	1990	1990
query12	156	97	97	97
query13	1286	628	423	423
query14	6066	4671	4350	4350
query14_1	3811	3813	3816	3813
query15	204	208	178	178
query16	1068	494	463	463
query17	1146	675	545	545
query18	2702	451	329	329
query19	204	182	142	142
query20	105	100	97	97
query21	233	155	134	134
query22	13095	12983	12842	12842
query23	17345	16386	16011	16011
query23_1	16116	16099	16095	16095
query24	7611	1684	1237	1237
query24_1	1265	1229	1251	1229
query25	549	427	352	352
query26	1320	363	206	206
query27	2580	594	373	373
query28	4433	2060	2050	2050
query29	1088	597	486	486
query30	339	261	229	229
query31	1110	1085	946	946
query32	105	63	58	58
query33	523	311	245	245
query34	1193	1146	637	637
query35	737	745	627	627
query36	797	783	712	712
query37	152	104	88	88
query38	1830	1641	1598	1598
query39	817	819	797	797
query39_1	787	788	796	788
query40	248	159	140	140
query41	71	76	78	76
query42	99	92	89	89
query43	318	319	275	275
query44	1475	796	788	788
query45	191	171	161	161
query46	1045	1172	730	730
query47	1546	1546	1402	1402
query48	415	398	301	301
query49	584	404	290	290
query50	1022	453	341	341
query51	10552	10376	10535	10376
query52	84	86	76	76
query53	266	288	204	204
query54	281	258	221	221
query55	75	71	66	66
query56	301	304	320	304
query57	1004	1011	919	919
query58	288	250	229	229
query59	1552	1627	1401	1401
query60	300	275	270	270
query61	181	177	173	173
query62	397	328	271	271
query63	237	212	205	205
query64	2932	1182	987	987
query65	3897	3827	3801	3801
query66	1774	488	380	380
query67	28310	28192	28108	28108
query68	3286	1623	985	985
query69	431	316	282	282
query70	928	818	828	818
query71	379	344	323	323
query72	3298	2683	2352	2352
query73	830	806	432	432
query74	4635	4507	4322	4322
query75	2364	2321	1999	1999
query76	2308	1146	830	830
query77	349	375	279	279
query78	11165	11020	10588	10588
query79	1459	1082	762	762
query80	1300	562	454	454
query81	519	330	284	284
query82	641	158	114	114
query83	368	345	304	304
query84	275	164	132	132
query85	971	625	524	524
query86	419	235	222	222
query87	1826	1789	1681	1681
query88	3809	2864	2803	2803
query89	421	327	281	281
query90	1924	197	200	197
query91	205	193	168	168
query92	65	59	57	57
query93	1659	1513	1052	1052
query94	736	362	305	305
query95	781	618	453	453
query96	1048	801	373	373
query97	2513	2444	2340	2340
query98	202	197	195	195
query99	725	724	606	606
Total cold run time: 257279 ms
Total hot run time: 169674 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.06	0.05
query3	0.25	0.13	0.13
query4	1.60	0.14	0.14
query5	0.24	0.21	0.22
query6	1.16	0.87	0.77
query7	0.04	0.01	0.00
query8	0.06	0.04	0.03
query9	0.38	0.30	0.32
query10	0.59	0.56	0.59
query11	0.20	0.13	0.13
query12	0.18	0.14	0.14
query13	0.45	0.46	0.46
query14	1.01	0.99	0.99
query15	0.61	0.58	0.59
query16	0.31	0.34	0.33
query17	1.06	1.04	1.06
query18	0.21	0.19	0.20
query19	2.05	1.86	1.98
query20	0.02	0.01	0.01
query21	15.45	0.19	0.13
query22	4.92	0.06	0.05
query23	16.12	0.29	0.12
query24	3.01	0.44	0.36
query25	0.12	0.05	0.05
query26	0.74	0.19	0.15
query27	0.04	0.03	0.04
query28	3.60	0.82	0.33
query29	12.49	4.01	3.16
query30	0.27	0.16	0.16
query31	2.76	0.54	0.32
query32	3.22	0.59	0.48
query33	3.24	3.19	3.14
query34	15.53	3.97	3.31
query35	3.22	3.22	3.23
query36	0.55	0.44	0.42
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.15	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.31 s
Total hot run time: 23.73 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 on df33c9fac9e676ca89b64cd6384de60ee9aeac45: the current implementation still has two P1 blockers at the new scan boundaries and one P2 contract mismatch. I reviewed the complete 77-path aggregate diff and deduplicated against the supplied live threads, so already-raised issues are not repeated below.

Critical checkpoint conclusions

  • Goal and proof: The goal is end-to-end Iceberg V3 initial/write-default correctness across schema evolution, equality deletes, branches, and V1/V2 Parquet/ORC paths. It is not yet achieved: complex read defaults do not have a producer/consumer-compatible typed carrier, and the plugin scan path reintroduces a projection-blind rolling-upgrade fence. The PR adds broad tests, but neither real FE-to-BE complex-default transport nor a pruned nested plugin projection is covered.
  • Scope and clarity: The change is necessarily broad because it spans connector metadata, Nereids analysis, Thrift, both BE scanners, and Iceberg commits. The new statement/write-context abstractions make ownership clearer, but the duplicate legacy/plugin scan contracts and stale branch documentation show the result is not yet internally coherent.
  • Concurrency: I traced statement-scope pinning, shared-table avoidance, fresh mutable table loads, concurrent schema changes, and final TableOperations validation. No additional distinct lock-order or concurrency issue survived deduplication; the remaining prepared-state, authenticator, and commit-replay concerns are already covered by live threads.
  • Lifecycle: Analysis, sink construction, transaction begin/replay/commit, scanner preparation, repeated batches, and cleanup paths were checked. No new lifecycle leak or cross-statement state issue was found beyond the existing threads.
  • Configuration: No new Doris runtime configuration is added. Existing varbinary/timestamp mapping and writer properties are threaded into the pinned contexts, but the legacy binary mapping exposes the missing recursive type marker in the first inline issue.
  • Compatibility and rolling upgrade: The scan-semantics marker and source-BE rejection cover result-changing reader behavior, but the plugin provider computes that requirement from full top-level subtrees instead of the resolved nested projection, causing avoidable query rejection for the full upgrade window.
  • Parallel paths: V1/V2, Parquet/ORC, legacy/plugin scans, ordinary/time-travel/ref reads, and INSERT/UPDATE/DELETE/MERGE/overwrite paths were compared. The first finding affects both scanners at their shared FE carrier boundary; the second is a genuinely different reintroduction in the plugin-provider path after the legacy path was fixed.
  • Special conditions: Required/optional fields, parent NULLs, explicit NULL/default, field-ID/name mapping, historical equality keys, branch advancement, and smooth-upgrade source backends were checked. Other substantiated edge cases already have live comments and were suppressed as duplicates.
  • Test coverage: Unit, regression, Docker fixture, negative, and mixed-version coverage is extensive, but the changed tests handcraft the complex JSON/binary marker instead of exercising the production carrier, and the plugin test explicitly assumes all-descendant expansion rather than testing a pruned sibling.
  • Test results: This was a static-only review; I did not build or run tests. The author reports broad focused suites and ASAN builds, while an existing current-head live thread reports a reproducible failure in branchWriteAllowsCurrentRequiredFieldWithInitialDefault because its fixture remains format v2. The claimed test status therefore is not presently sufficient proof.
  • Observability: New failures generally include field, table, schema, branch, or backend context. I found no distinct need for another metric/log beyond issues already raised; the main remaining failures are deterministic contract violations.
  • Persistence, transactions, and failover: This does not add FE EditLog state. Iceberg metadata durability remains under Iceberg transaction/CAS semantics, and the pinned bundle plus validating operations wrapper addresses replay-time metadata drift. No additional distinct failover issue was found.
  • Data-write atomicity and crash behavior: Schema/spec/order/file/metrics settings are pinned and revalidated before commit, and BE failures propagate as non-OK status. No new atomicity or crash-leak defect survived the existing-thread deduplication pass.
  • FE-to-BE propagation: Recursive TField metadata and scan-semantics versioning are sent on the changed paths, but complex parent JSON and binary-leaf identity are not produced in the shape the new BE decoder consumes; this is a blocking protocol-contract gap.
  • Performance: The changed planning/history and ORC normalization paths were reviewed for bounds, copies, and per-row work. The known ORC normalization overhead already has a live P2 thread; no duplicate is added. The plugin gate issue is primarily an availability regression rather than CPU cost.
  • Other and review focus: The durable design and the current PR release note still promise table-global current schema for branch writes, while current code/tests intentionally use branch-head schema. There was no additional user-provided review focus, so the full PR was reviewed without narrowing scope.

The three inline comments below are the complete new comment set for this head. All other verified concerns are either dismissed with code evidence or already represented by existing review threads.

const auto primitive_type = value_type->get_primitive_type();
if (is_complex_type(primitive_type)) {
rapidjson::Document document;
document.Parse(field.initial_default_value.data(), field.initial_default_value.size());

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.

[P1] Send a complete typed complex-default carrier

This decoder assumes the parent initial_default_value is SingleValueParser JSON, but FE still sends every non-binary value through identity(...).toHumanString(), so complex defaults do not reach it in the required form. Legacy STRING/CHAR mapping also decodes binary leaves only when their child TField has initial_default_value_is_base64, while FE sets that flag only if the child itself has a default; list/map leaves normally do not. The new BE test manually sets the flag, masking production. Please serialize complex parents as Iceberg JSON, mark every UUID/FIXED/BINARY schema leaf by type, and add an FE-to-reader test.

// that null to ImmutableSet.copyOf. The top-level id is already present, and only nested types
// have descendant ids to add.
if (field.type().isNestedType()) {
projected.addAll(TypeUtil.getProjectedIds(field.type()));

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.

[P1] Keep the smooth-upgrade gate projection-aware

PluginDrivenScanNode reduces each selected slot to an IcebergColumnHandle containing only the top-level field ID; it drops the slot's pruned type/access path. This line then expands that field to every descendant, so SELECT s.a is rejected whenever an unselected sibling s.b has an initial default and any source BE remains, even though BE never reads b. The legacy scan path was already fixed for this availability regression. Please carry the resolved nested projection into this provider and add a planner-level unselected-sibling test.

1. Omitted INSERT columns, explicit `DEFAULT`, reordered/multi-row VALUES, supported
`DEFAULT(column)`, and MERGE `NOT MATCHED INSERT` consume the typed `write-default` from the
statement-pinned current table schema. A branch target selects the snapshot lineage that receives
the commit; schema evolution remains table-global, so columns added or renamed after the branch

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.

[P2] Align the branch-schema contract with the implementation

The current provider now pins SnapshotUtil.schemaFor(table, branchHead), and the changed regression intentionally rejects current-only zone until the first successful old-schema branch write advances the ref. These criteria instead promise that post-branch additions/renames are immediately writable and that branch choice affects only the commit target. Please update this section and the read matrix/release note to state the branch-head schema behavior; otherwise this durable design documents the opposite of the behavior the PR implements and tests.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 43.55% (81/186) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17668	4095	4109	4095
q2	2063	332	203	203
q3	10645	1342	821	821
q4	4736	474	333	333
q5	8134	836	545	545
q6	272	172	135	135
q7	770	803	603	603
q8	10485	1613	1576	1576
q9	5463	4119	4087	4087
q10	6818	1643	1388	1388
q11	513	342	335	335
q12	729	569	456	456
q13	18191	3280	2719	2719
q14	265	262	243	243
q15	q16	739	730	667	667
q17	2085	1056	950	950
q18	6887	5757	5538	5538
q19	1574	1298	1183	1183
q20	768	673	558	558
q21	5688	2613	2458	2458
q22	447	363	303	303
Total cold run time: 104940 ms
Total hot run time: 29196 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4316	4279	4250	4250
q2	294	315	209	209
q3	4492	4927	4327	4327
q4	2195	2249	1414	1414
q5	4277	4144	4137	4137
q6	231	174	127	127
q7	2047	1856	1571	1571
q8	2464	2136	2060	2060
q9	7315	7412	7464	7412
q10	4285	4263	3901	3901
q11	575	416	381	381
q12	720	716	494	494
q13	3392	3491	2853	2853
q14	296	305	276	276
q15	q16	722	751	635	635
q17	1357	1345	1343	1343
q18	8050	7204	7044	7044
q19	1061	1069	1088	1069
q20	2186	2197	1913	1913
q21	5312	4627	4394	4394
q22	529	473	394	394
Total cold run time: 56116 ms
Total hot run time: 50204 ms

@hello-stephen

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

query5	4328	627	470	470
query6	452	221	254	221
query7	4898	610	335	335
query8	334	191	164	164
query9	8756	4093	4085	4085
query10	463	360	304	304
query11	5691	2223	2037	2037
query12	185	96	96	96
query13	1250	586	422	422
query14	6038	4703	4381	4381
query14_1	3790	3827	3775	3775
query15	212	200	176	176
query16	1049	469	446	446
query17	1091	665	535	535
query18	2592	476	340	340
query19	196	184	143	143
query20	108	102	100	100
query21	229	157	136	136
query22	13053	13031	12860	12860
query23	17233	16280	16001	16001
query23_1	16135	16113	16109	16109
query24	7524	1712	1220	1220
query24_1	1266	1225	1248	1225
query25	522	436	357	357
query26	1312	353	218	218
query27	2578	604	376	376
query28	4474	2074	2015	2015
query29	1045	601	462	462
query30	337	259	226	226
query31	1107	1079	950	950
query32	111	62	60	60
query33	507	314	236	236
query34	1182	1097	639	639
query35	742	747	645	645
query36	790	784	708	708
query37	154	106	87	87
query38	1828	1638	1591	1591
query39	826	822	788	788
query39_1	791	807	798	798
query40	241	163	145	145
query41	66	66	63	63
query42	91	95	90	90
query43	323	319	293	293
query44	1442	801	779	779
query45	184	193	164	164
query46	1010	1188	736	736
query47	1507	1504	1455	1455
query48	410	406	288	288
query49	576	407	295	295
query50	1018	454	338	338
query51	10281	10416	10349	10349
query52	89	86	74	74
query53	262	285	194	194
query54	284	231	218	218
query55	74	70	67	67
query56	285	292	282	282
query57	1027	1000	917	917
query58	268	253	249	249
query59	1539	1608	1440	1440
query60	295	263	245	245
query61	151	149	152	149
query62	403	323	275	275
query63	239	196	202	196
query64	2824	1143	968	968
query65	3849	3818	3820	3818
query66	1860	498	374	374
query67	27795	28079	27988	27988
query68	3196	1604	1007	1007
query69	423	303	275	275
query70	915	806	798	798
query71	369	339	329	329
query72	3183	2703	2310	2310
query73	867	808	470	470
query74	4633	4520	4308	4308
query75	2397	2345	1984	1984
query76	2355	1169	788	788
query77	340	363	286	286
query78	11047	11080	10643	10643
query79	1398	1251	731	731
query80	1295	555	470	470
query81	531	335	282	282
query82	598	157	116	116
query83	404	320	303	303
query84	282	161	129	129
query85	999	596	527	527
query86	405	231	219	219
query87	1799	1787	1743	1743
query88	3796	2846	2819	2819
query89	411	321	279	279
query90	1912	199	204	199
query91	205	188	169	169
query92	62	63	56	56
query93	1632	1541	1012	1012
query94	718	361	287	287
query95	789	608	466	466
query96	1052	773	369	369
query97	2461	2474	2312	2312
query98	203	198	195	195
query99	734	724	598	598
Total cold run time: 255217 ms
Total hot run time: 169921 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.14	0.08	0.08
query3	0.39	0.25	0.25
query4	1.60	0.25	0.25
query5	0.34	0.33	0.32
query6	1.16	0.67	0.67
query7	0.04	0.01	0.01
query8	0.09	0.08	0.07
query9	0.50	0.39	0.39
query10	0.60	0.59	0.58
query11	0.31	0.18	0.20
query12	0.31	0.18	0.19
query13	0.52	0.53	0.52
query14	0.91	0.92	0.91
query15	0.67	0.59	0.60
query16	0.40	0.40	0.41
query17	1.07	1.00	0.97
query18	0.29	0.29	0.29
query19	1.90	1.81	1.77
query20	0.02	0.02	0.01
query21	15.40	0.36	0.32
query22	4.88	0.14	0.14
query23	15.83	0.49	0.30
query24	2.37	0.62	0.44
query25	0.15	0.10	0.10
query26	0.75	0.27	0.22
query27	0.10	0.10	0.10
query28	3.51	0.83	0.43
query29	12.50	4.13	3.25
query30	0.38	0.27	0.27
query31	2.77	0.56	0.34
query32	3.23	0.60	0.47
query33	2.99	2.91	3.01
query34	15.83	3.96	3.28
query35	3.20	3.20	3.19
query36	0.67	0.54	0.51
query37	0.12	0.09	0.09
query38	0.08	0.07	0.07
query39	0.08	0.06	0.07
query40	0.21	0.18	0.17
query41	0.13	0.08	0.08
query42	0.09	0.06	0.06
query43	0.07	0.07	0.08
Total cold run time: 96.61 s
Total hot run time: 25.31 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.36% (28/195) 🎉
Increment coverage report
Complete coverage report

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.

5 participants