Skip to content

[fix](iceberg) Publish Parquet split offsets in data file metadata - #69615

Merged
Gabriel39 merged 2 commits into
apache:masterfrom
Gabriel39:fix/iceberg-parquet-split-offsets
Oct 26, 2026
Merged

Gabriel39 merged 2 commits into
apache:masterfrom
Gabriel39:fix/iceberg-parquet-split-offsets

Conversation

@Gabriel39

@Gabriel39 Gabriel39 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Doris writes Parquet row groups for Iceberg data files but does not publish their split offsets in commit fragments or manifests. Readers cannot use those known boundaries when planning splits.

Collect row-group starts from the closed writer's in-memory Footer, including dictionary pages, and carry them through an optional Thrift field into Iceberg data-file metadata. Keep collection independent of column metrics policy; leave older BE fragments, empty files, ORC and delete files without Parquet offsets.

When a file metadata-table scan requests split_offsets, also project file_size_in_bytes: Iceberg uses the size to validate offsets and otherwise returns null for valid values. Append this dependency after the requested columns to preserve the BE JNI reader's positional contract.

Release note

Publish Parquet row-group split offsets in Iceberg manifests and preserve them in projected file metadata-table scans.

Validation

  • Maven reactor build passed: 212 IcebergScanPlanProviderTest tests and 31 IcebergWriterHelperTest tests, including Manifest round trips and per-file isolation.
  • The projection regression failed before the fix and passes afterward. It covers files/data_files/all_files/all_data_files, partitioned/unpartitioned tables and five requested-column orders.
  • 6 targeted BE ASAN tests passed for dictionary/plain pages, multiple/single/empty row groups, metrics-disabled Parquet commits and unchanged ORC behavior. Changed source, generated Thrift and unity objects were linked with cached engine libraries; this was not a clean full BE rebuild.
  • FE Checkstyle, clang-format 16, BE build hygiene and connector import checks passed.
  • Checked the optional Thrift field ID against master and release branches 3.1, 4.0, 4.1 and 4.2.
  • Extended the partitioned-write external regression to assert split offsets, including with column metrics disabled. CI validation of the latest revision and Spark/Trino interoperability remain pending.

Check List (For Author)

  • Test: Unit Test and Regression test
  • Behavior changed: Yes. Newly written Iceberg Parquet data files publish optional split offsets, which projected file metadata scans can return.
  • Does this need documentation? No.

@hello-stephen

Copy link
Copy Markdown
Contributor

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

Please clearly describe your PR:

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

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

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

Reviewed all nine changed files at a2a1cf5. No new actionable findings or existing blocking inline findings were identified. Review converged in one round: the complete BE reviewer, complete FE/protocol/test reviewer, and separate physical-offset risk reviewer all returned NO_NEW_VALUABLE_FINDINGS; every investigated candidate and risk has an evidence-based disposition.

The execution chain reviewed was:

Parquet data writer -> successful Close -> retained Arrow footer
  -> per-file TIcebergCommitData.split_offsets (optional field 15)
  -> final BE report -> FE binary fragment -> Iceberg DataFile
  -> atomic manifest/snapshot commit -> eager/streaming split planning

Critical checkpoint conclusions:

  1. Goal and evidence: the change publishes Parquet row-group starts, including dictionary pages, independently of column metrics. Added BE tests inspect real footers; FE tests check protocol decoding and manifest readback. Tests were inspected, not executed.
  2. Scope and reuse: the production change is confined to footer collection, the shared data-file commit builder, optional transport metadata, and the existing SDK DataFiles builder.
  3. Concurrency and locks: offsets are local to each closed writer/file. Existing sorter locking and synchronized FE transaction/report paths remain in effect; no new thread, lock order, or shared mutable state was introduced.
  4. Lifecycle and static initialization: Arrow retains its shared footer after Close; collection precedes transformer destruction and report publication. Sorted and unsorted rollover close the old writer first. No ownership cycle or static initialization dependency was added. This matches Arrow 24 footer ownership.
  5. Configuration: no setting was added. Existing metrics-disabled policy intentionally does not suppress physical split offsets.
  6. Compatibility: Parquet file layout is unchanged; absent old-BE offsets remain absent, and older Thrift readers can skip the new optional field. Existing Iceberg manifest metadata is populated through the SDK.
  7. Thrift/protobuf: TIcebergCommitData was compared directly on HEAD and branch-3.1, branch-4.0, branch-4.1, and branch-4.2. Field 15 is unused on all four branches and optional here; existing IDs retain their meanings. No protobuf change.
  8. Parallel paths: INSERT, overwrite, UPDATE/MERGE data, rewrite, sorted output and per-file rollover reach the modified common path. ORC and delete-file conversion correctly exclude these Parquet data offsets.
  9. Conditional checks: missing metadata fails; empty files/groups omit offsets; dictionary presence includes the earlier page; FE format/null/empty checks handle ORC and old fragments. Comments explain these cases.
  10. Test coverage: new tests cover dictionary/plain, multiple/single/empty row groups, repeated collection, metrics disabled, per-file isolation, absent optional fields, ORC exclusion, and manifest roundtrip. Regression checks inspect offsets with metrics on/off. Nested/null-only, sorted-rollover and mixed-version execution have no dedicated new offset tests; their control flow was reviewed statically.
  11. Test results and conventions: no expected-result files changed. New regression checks use deterministic assertEquals calls rather than the repository-preferred qt snapshots; this is a test-convention deviation, with no demonstrated functional defect.
  12. Observability: the existing Iceberg $files metadata exposes offsets. Existing close/report/commit error paths surface failures, and the report-size guard measures the complete expanded fragment.
  13. Persistence and failover: offsets follow existing SDK manifest/snapshot commits; no new FE EditLog or crash-recovery state is introduced. Native partition visible-version and delete-bitmap rules are unaffected.
  14. Writes and atomicity: collection/report errors prevent successful publication and enter existing file cleanup. MERGE retains cleanup ownership until sibling data/delete close results are known; snapshot publication keeps the existing transaction boundary.
  15. FE/BE propagation: complete generated-Thrift structs are copied, budgeted, serialized and decoded; there is no hand-picked transport stage dropping field 15. Each file receives a fresh builder and independent offsets.
  16. Performance and memory: collection reads the retained footer without reopening the file; extra work/storage scale with row groups, plus sorting. FE list copies and existing cache accounting cover the added metadata. No new per-row work or significant unbounded buffer was found.
  17. Other risks: dictionary/data starts and physical leaf order match Iceberg's split-offset extraction. The resulting half-open split intervals agree with Doris native row-group midpoint selection; nested/Variant/null-only paths and nonzero first offsets yielded no reachable counterexample.

No additional user focus was supplied. No unresolved static candidate or unreviewed changed file remains. Validation limits: this invocation performed static review only; it ran no builds, tests, mixed-version binaries, external regression environment, or Spark/Trino interoperability checks. The PR author's reported execution was not independently reproduced.

Review converged after 1 round(s).

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17595	5202	5082	5082
q2	2184	327	254	254
q3	10227	1398	842	842
q4	4677	459	344	344
q5	7431	807	533	533
q6	185	185	152	152
q7	763	809	606	606
q8	9250	1357	1083	1083
q9	5614	4229	4210	4210
q10	6846	1315	1031	1031
q11	442	244	238	238
q12	641	407	291	291
q13	18118	3743	3042	3042
q14	277	275	250	250
q15	q16	723	724	669	669
q17	1201	753	586	586
q18	7175	6165	6146	6146
q19	1098	966	615	615
q20	377	331	227	227
q21	5186	2172	2330	2172
q22	350	299	251	251
Total cold run time: 100360 ms
Total hot run time: 28624 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5636	5616	5633	5616
q2	692	571	549	549
q3	5230	5423	4929	4929
q4	2024	2177	1559	1559
q5	5262	5171	5828	5171
q6	247	198	152	152
q7	2330	2155	1876	1876
q8	3148	3011	2765	2765
q9	8171	8031	8014	8014
q10	3793	3734	3262	3262
q11	645	460	428	428
q12	699	684	510	510
q13	3530	3938	3199	3199
q14	297	313	286	286
q15	q16	692	698	647	647
q17	8432	7487	7419	7419
q18	13065	12281	12906	12281
q19	989	784	780	780
q20	2155	2190	1932	1932
q21	5782	4646	4788	4646
q22	511	446	399	399
Total cold run time: 73330 ms
Total hot run time: 66420 ms

@hello-stephen

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

query5	4313	591	446	446
query6	434	208	188	188
query7	4796	441	224	224
query8	322	165	156	156
query9	8785	3132	3137	3132
query10	489	306	263	263
query11	5878	3871	3593	3593
query12	144	92	87	87
query13	1248	420	332	332
query14	6127	3893	3675	3675
query14_1	3432	3411	3412	3411
query15	203	194	186	186
query16	954	425	389	389
query17	816	630	508	508
query18	2410	403	290	290
query19	185	162	127	127
query20	83	80	81	80
query21	207	123	104	104
query22	12992	13078	12742	12742
query23	13378	12794	12528	12528
query23_1	12504	12451	12537	12451
query24	7381	830	467	467
query24_1	469	477	469	469
query25	506	402	345	345
query26	1283	257	137	137
query27	2778	436	267	267
query28	4645	1962	1955	1955
query29	1557	605	452	452
query30	295	229	188	188
query31	1007	942	846	846
query32	151	94	99	94
query33	540	313	249	249
query34	998	851	499	499
query35	740	747	648	648
query36	827	814	736	736
query37	132	103	90	90
query38	1802	1712	1689	1689
query39	798	789	748	748
query39_1	733	719	730	719
query40	223	116	101	101
query41	74	69	66	66
query42	90	85	85	85
query43	350	363	315	315
query44	1302	692	693	692
query45	178	185	166	166
query46	830	967	582	582
query47	2876	2875	2827	2827
query48	318	331	244	244
query49	586	421	326	326
query50	667	268	210	210
query51	11075	11142	10912	10912
query52	84	83	74	74
query53	190	222	151	151
query54	252	194	176	176
query55	85	67	61	61
query56	219	227	195	195
query57	1667	1613	1575	1575
query58	284	243	255	243
query59	2126	2090	1968	1968
query60	282	237	236	236
query61	144	160	138	138
query62	394	329	285	285
query63	184	153	156	153
query64	2720	921	796	796
query65	3294	3244	3269	3244
query66	1760	429	326	326
query67	20324	20353	19968	19968
query68	3091	1012	610	610
query69	390	291	247	247
query70	873	781	768	768
query71	298	236	221	221
query72	2800	2614	2283	2283
query73	504	524	303	303
query74	4672	4546	4373	4373
query75	2362	2265	1907	1907
query76	2320	1021	595	595
query77	339	366	267	267
query78	9798	9635	9156	9156
query79	1029	781	517	517
query80	1086	411	339	339
query81	567	333	282	282
query82	566	134	106	106
query83	300	199	181	181
query84	308	123	103	103
query85	871	427	363	363
query86	373	242	228	228
query87	1980	1967	1847	1847
query88	3645	2694	2663	2663
query89	324	272	249	249
query90	1869	167	170	167
query91	155	152	126	126
query92	100	81	88	81
query93	1016	980	572	572
query94	603	301	280	280
query95	586	353	361	353
query96	659	474	237	237
query97	2463	2428	2328	2328
query98	185	153	150	150
query99	770	758	637	637
Total cold run time: 235624 ms
Total hot run time: 151563 ms

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.04
query3	0.26	0.08	0.09
query4	1.61	0.10	0.10
query5	0.24	0.24	0.24
query6	1.18	0.69	0.68
query7	0.04	0.00	0.00
query8	0.05	0.04	0.04
query9	0.39	0.33	0.36
query10	0.57	0.59	0.58
query11	0.20	0.15	0.14
query12	0.18	0.15	0.15
query13	0.49	0.49	0.49
query14	1.04	1.01	1.00
query15	0.64	0.60	0.61
query16	0.36	0.35	0.35
query17	1.17	1.16	1.09
query18	0.20	0.19	0.19
query19	2.13	1.96	1.96
query20	0.02	0.01	0.02
query21	15.48	0.19	0.13
query22	4.96	0.05	0.06
query23	16.30	0.33	0.12
query24	2.99	0.59	0.42
query25	0.11	0.06	0.08
query26	1.51	0.21	0.16
query27	0.05	0.05	0.03
query28	3.19	0.74	0.35
query29	12.48	4.13	3.28
query30	0.29	0.14	0.10
query31	2.78	0.56	0.33
query32	3.23	0.60	0.50
query33	3.09	3.20	3.15
query34	15.50	4.01	3.41
query35	3.38	3.36	3.34
query36	0.58	0.51	0.56
query37	0.10	0.07	0.07
query38	0.06	0.05	0.04
query39	0.04	0.04	0.04
query40	0.18	0.15	0.16
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.05	0.03	0.03
Total cold run time: 97.34 s
Total hot run time: 24.39 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.

Reviewed PR #69615 at head 776501a04ef4c78fbadf32c25382ed7ca9b659c0. No new actionable finding was verified, and there are no existing inline findings to carry forward. All 11 changed files and their affected producer, transport, commit and reader paths were reviewed.

Critical checkpoint conclusions:

  1. Goal and evidence: closed Parquet row-group starts reach per-file Iceberg manifest metadata independently of column metrics. Dictionary handling agrees with the upstream Parquet start-offset definition. Added BE/FE tests exercise the main behavior; this review did not execute them.
  2. Scope and reuse: the changes are focused and reuse the common partition writer and FE data-file builder.
  3. Concurrency and locks: extraction uses the existing write/close lifecycle; sorted spill operations retain their existing mutex. Commit receipt and publication retain existing serialization. No new thread, shared cache, lock order or blocking operation was introduced.
  4. Lifecycle and memory: the retained Arrow writer owns metadata after close. Offset vectors and builders are per file; no new ownership cycle or static initialization dependency was found. Existing report-size accounting includes serialized offsets.
  5. Configuration: no production setting is added. The existing metrics policy remains independent; test configuration overrides are restored.
  6. Compatibility: absent or empty offsets preserve older fragments; ORC and delete-file metadata retain their prior behavior. The manifest field is already defined by Iceberg, with no new physical data encoding.
  7. Thrift/protobuf: the full touched definition was compared on HEAD and current master, 3.1, 4.0, 4.1 and 4.2 refs, verified against the remote. Field 15 is unused there, optional, and does not change existing field meanings.
  8. Parallel paths: partitioned/unpartitioned, sorted/unsorted and rolling data writers converge on the collector. INSERT, OVERWRITE, UPDATE/MERGE data and REWRITE converge on the FE helper; separate delete paths were checked.
  9. Conditions: metadata availability, empty groups, dictionary pages, format selection and optional-field checks have concrete explanations. Missing required writer metadata returns failure.
  10. Test coverage: new tests cover dictionary/plain pages, zero/one/multiple groups, repeat collection, metrics disabled, wire decoding, per-file isolation, old fragments, ORC exclusion, manifest round trips and requested-column order across four metadata-table variants and both partitioning modes. The external regression adds offset checks with metrics enabled and disabled.
  11. Expected results: no result file changed; existing row/file aggregates remain consistent. New footer-derived offset expectations match the write layout. Runtime results were not independently reproduced.
  12. Observability and errors: collection/report failures propagate through existing close and cleanup handling; no new transaction stage or logging/metric requirement was identified.
  13. Persistence and failover: offsets enter the existing atomic Iceberg snapshot commit with their data file. No additional Doris EditLog state or independent persistence step is needed; existing rollback ownership is preserved.
  14. Writes and crashes: files close before metadata is reported; extraction/report errors retain existing failed-file cleanup. No new publication window or partial metadata operation was found.
  15. FE/BE passing: whole-object Thrift serialization preserves the optional list through final reports and connector deserialization. Appending file size after requested metadata columns satisfies Iceberg's offset validation while the JNI reader consumes the requested leading positions.
  16. Performance: collection reads the in-memory footer, with O(row groups) storage and O(groups log groups) sorting; it adds no file reopen or per-row work. Metadata projection adds one scalar dependency only when needed and retains pruning of unrequested readable metrics.
  17. Other invariants: data visibility, native-table versions and MoW delete bitmaps are unaffected. Physical split ownership was traced through both Parquet reader implementations. No new hub-header/PCH/template or glibc compatibility concern was identified statically.

User focus: no additional focus was supplied. The initial offset, projection/JNI and wire-compatibility concerns were all dismissed with source evidence; no correctness candidate remains unresolved.

Validation limits: static review only; no build, style command, unit/regression test, live JNI, mixed-version run, final ELF audit, or Spark/Trino interoperability check was performed. Dedicated nested/all-null offset, sorted rollover and collector-failure tests are absent; those mechanisms were inspected statically. Delete-metadata and predicate-only projection combinations also lack new execution coverage. Review convergence concerns the completed static review, not runtime certification.

Review converged after 3 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.94% (2099/2728)
Line Coverage 66.13% (38695/58515)
Region Coverage 53.71% (36280/67549)
Branch Coverage 57.36% (11827/20618)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 81.82% (18/22) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 66.90% (32180/48105)
Line Coverage 51.71% (340189/657941)
Region Coverage 47.13% (275768/585118)
Branch Coverage 48.83% (130022/266296)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17591	5160	5074	5074
q2	2137	342	252	252
q3	10207	1430	821	821
q4	4675	466	332	332
q5	7446	804	521	521
q6	180	186	153	153
q7	753	811	612	612
q8	9258	1335	1108	1108
q9	5458	4218	4201	4201
q10	6835	1300	1031	1031
q11	446	252	233	233
q12	634	397	290	290
q13	18149	3637	3029	3029
q14	274	274	254	254
q15	q16	751	726	656	656
q17	1197	740	580	580
q18	7079	6201	6125	6125
q19	1108	954	588	588
q20	389	340	237	237
q21	5483	2175	2291	2175
q22	356	303	251	251
Total cold run time: 100406 ms
Total hot run time: 28523 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5654	5598	5595	5595
q2	676	568	538	538
q3	5252	5368	4910	4910
q4	2019	2144	1545	1545
q5	5259	5200	5769	5200
q6	265	198	149	149
q7	2336	2116	1867	1867
q8	3119	2957	2715	2715
q9	8132	8131	8105	8105
q10	3733	3664	3288	3288
q11	621	445	405	405
q12	690	687	561	561
q13	3653	3928	3245	3245
q14	301	302	280	280
q15	q16	735	731	639	639
q17	8724	7605	6909	6909
q18	12957	12214	12943	12214
q19	921	779	777	777
q20	2121	2150	1908	1908
q21	5682	4611	4684	4611
q22	493	482	416	416
Total cold run time: 73343 ms
Total hot run time: 65877 ms

@hello-stephen

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

query5	4324	577	444	444
query6	431	217	190	190
query7	4820	444	218	218
query8	317	169	153	153
query9	8791	3105	3130	3105
query10	477	303	253	253
query11	5998	3881	3549	3549
query12	153	92	89	89
query13	1240	434	335	335
query14	6156	3942	3654	3654
query14_1	3432	3411	3417	3411
query15	213	197	177	177
query16	951	441	439	439
query17	856	663	531	531
query18	2421	432	317	317
query19	197	179	138	138
query20	86	84	86	84
query21	208	131	111	111
query22	13062	13059	12839	12839
query23	13464	12910	12400	12400
query23_1	12533	12526	12579	12526
query24	7376	835	472	472
query24_1	490	473	478	473
query25	542	423	362	362
query26	1275	262	144	144
query27	2755	456	270	270
query28	4636	1946	1943	1943
query29	1579	604	477	477
query30	299	221	183	183
query31	1009	929	816	816
query32	151	92	95	92
query33	531	310	252	252
query34	919	850	497	497
query35	748	823	650	650
query36	819	807	723	723
query37	120	100	82	82
query38	1770	1727	1673	1673
query39	780	798	734	734
query39_1	723	721	744	721
query40	213	109	91	91
query41	63	63	60	60
query42	82	80	81	80
query43	339	358	315	315
query44	1297	681	694	681
query45	186	175	166	166
query46	829	995	589	589
query47	2935	2951	2706	2706
query48	284	301	213	213
query49	566	405	288	288
query50	670	267	205	205
query51	10591	10541	10438	10438
query52	77	78	70	70
query53	190	211	157	157
query54	226	188	172	172
query55	70	70	62	62
query56	247	206	216	206
query57	1665	1636	1578	1578
query58	289	263	253	253
query59	2159	2163	1993	1993
query60	283	241	230	230
query61	148	144	173	144
query62	387	330	284	284
query63	186	157	160	157
query64	2717	908	768	768
query65	3336	3277	3265	3265
query66	1775	417	304	304
query67	20220	20185	19993	19993
query68	3221	987	610	610
query69	412	308	261	261
query70	849	773	761	761
query71	301	239	212	212
query72	2805	2645	2301	2301
query73	531	521	297	297
query74	4653	4531	4352	4352
query75	2375	2293	1904	1904
query76	2408	1010	600	600
query77	363	375	277	277
query78	9719	9699	9226	9226
query79	996	834	531	531
query80	1227	434	353	353
query81	581	317	266	266
query82	616	134	102	102
query83	308	193	185	185
query84	309	123	99	99
query85	865	481	379	379
query86	400	236	232	232
query87	2023	1962	1822	1822
query88	3682	2687	2661	2661
query89	335	285	243	243
query90	1912	167	164	164
query91	155	148	140	140
query92	101	89	97	89
query93	1055	977	575	575
query94	629	273	278	273
query95	587	332	360	332
query96	651	486	233	233
query97	2420	2440	2320	2320
query98	156	158	151	151
query99	769	760	646	646
Total cold run time: 235783 ms
Total hot run time: 150958 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.10	0.05	0.04
query3	0.26	0.09	0.08
query4	1.61	0.10	0.09
query5	0.24	0.23	0.24
query6	1.18	0.68	0.69
query7	0.03	0.01	0.01
query8	0.05	0.04	0.04
query9	0.40	0.36	0.35
query10	0.56	0.61	0.57
query11	0.21	0.15	0.15
query12	0.18	0.14	0.14
query13	0.48	0.49	0.49
query14	1.04	1.01	1.02
query15	0.63	0.61	0.60
query16	0.33	0.35	0.35
query17	1.13	1.08	1.07
query18	0.21	0.19	0.19
query19	2.02	2.00	1.96
query20	0.02	0.01	0.01
query21	15.42	0.19	0.13
query22	4.93	0.06	0.05
query23	16.24	0.33	0.14
query24	3.02	0.68	0.54
query25	0.11	0.07	0.06
query26	1.66	0.22	0.15
query27	0.05	0.03	0.04
query28	3.31	0.72	0.36
query29	12.51	4.16	3.30
query30	0.29	0.14	0.10
query31	2.77	0.57	0.32
query32	3.22	0.59	0.50
query33	3.15	3.21	3.20
query34	15.34	4.03	3.40
query35	3.36	3.35	3.37
query36	0.55	0.64	0.50
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.15
query41	0.09	0.03	0.03
query42	0.03	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.15 s
Total hot run time: 24.56 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 81.82% (18/22) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.44% (36094/46609)
Line Coverage 62.64% (407745/650902)
Region Coverage 59.16% (344914/582990)
Branch Coverage 60.05% (159526/265644)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@Gabriel39
Gabriel39 merged commit 8d2bd1e into apache:master Oct 26, 2026
43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

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

Copy link
Copy Markdown
Contributor

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

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Oct 29, 2026
Apply the outstanding changes in master merge order:
apache#69545 7d16729
apache#69551 7224a2d
apache#69612 61d1aef
apache#69615 8d2bd1e
apache#69650 3dc7341
apache#69651 c00ecb1
apache#69646 e493c61
apache#69668 7865646

apache#69614 already exists on branch-4.2 through apache#69644.
Adapt datasource APIs and tests to the release branch, retaining its
existing scanner dispatch and statement-bound metadata contracts.
yiguolei pushed a commit that referenced this pull request Oct 30, 2026
### What problem does this PR solve?

Backport the requested external-data and FileScannerV2 changes to
`branch-4.2` in their actual master merge order:

| Order | Master PR | Change | Backport |
| --- | --- | --- | --- |
| 1 | #69545 | Preserve Paimon schema options after field renames |
Included |
| 2 | #69551 | Expand Iceberg capability, transaction and snapshot tests
| Included with 4.2 API adaptations |
| 3 | #69614 | Elasticsearch HTTP scans in FileScannerV2 | Already
present through #69644 (`2104b7509cda`); not applied twice |
| 4 | #69612 | Check catalog visibility before SHOW DATABASES accesses
metadata | Included |
| 5 | #69615 | Publish Iceberg Parquet split offsets | Included |
| 6 | #69650 | Preserve ES compound residuals and expand scanner
coverage | Included |
| 7 | #69651 | Accept Elasticsearch 9.x during node discovery | Included
|
| 8 | #69646 | Prioritize Parquet V2 row groups using TopN bounds |
Included |
| 9 | #69668 | Arrow loads and schema inference in FileScannerV2 |
Included |

The eight outstanding changes are combined in one commit. This branch
retains the 4.2 FE datasource APIs instead of importing master's
connector-module refactor.

### Backport adaptations

- Port Paimon schema restoration, catalog-option provenance, fallback
handling and tests to the existing table-copy/serialization lifecycle.
Keep statement-bound fields when reader options are applied after a
schema-only rename.
- Exercise Iceberg's existing metadata and transaction entry points with
real in-memory tables and retained-generation fixtures. Preserve the
nine disabled known-bug reproductions; omit two connector-only lifecycle
tests. Expiration checks verify live data-file sets and exact
delete-file counters; 4.2's separate manifest-name/data-counter issue
remains unchanged. The delete/history SQL suite checks visible rows and
eager/late-materialization parity because 4.2 does not expose master's
`_file`/`_pos` columns. The inventory labels upstream-only evidence
explicitly.
- Port ES residual tracking to the legacy planner and add compound
OR/NOT, docvalue eligibility and Thrift-context tests there. Use Java
8-compatible HTTP APIs for opt-in ES 9 tests and the branch's supported
node-address fixtures.
- Keep the existing full-schema Iceberg metadata-table scan, which
already supplies the file-size dependency for split offsets. Adapt the
external write suite to verify offsets without requiring master-only
distribution plans or golden output.
- Use the existing Parquet statistics interface and physical
row-location representation. Keep the TopN scheduling and pruning
invariants.
- Include the shared Arrow array normalizer required by the new reader,
taken from the same master revision. Preserve 4.2 Lance/Avro dispatch;
omit the schema-inference test for the unavailable Hive OpenCSV parser.

### Validation

- FE production and test sources compile with the branch's Java 8
target. Across the targeted runs and focused reruns, 20 test classes
report 181 discovered, 171 passed, zero failures/errors, and 10 skipped:
nine intentionally disabled known-bug reproductions plus the opt-in live
ES 9 class.
- FE Checkstyle: passed with zero violations.
- Clang compiler syntax checks: all 23 affected C++ translation units
passed against the current sources and freshly generated Thrift, using
cached third-party/generated build dependencies. Focused BE runtime
validation is listed below.
- clang-format 16: all 30 affected C++ source/header files passed.
- Groovy 4.0.19 syntax and AST conversion: all seven changed suites
passed. All 105 local inventory links resolve.
- Complete staged-diff self-review, whitespace/conflict checks, and
sensitive-information checks passed.

A full BE rebuild and SQL/external-service regressions were not run
locally. Live ES 9 tests require their opt-in endpoint. CI is requested
for the combined backport.

### Release note

Fix Paimon reads after field renames, external-catalog SHOW DATABASES
authorization, and ES compound residual filtering. Support ES 9.x node
discovery, publish Iceberg Parquet split offsets, improve Parquet V2
TopN row-group scheduling, and use FileScannerV2 for Arrow loads and
text/JSON schema inference.

### Check List (For Author)

- Test
    - [x] Unit Test
- [x] Regression test additions and syntax checks; SQL execution pending
CI
- Behavior changed:
    - [x] Yes. Backport the changes listed above.
- Does this need documentation?
- [x] No. Existing interfaces and settings are retained; the test
coverage inventory is included.

### Follow-up fixes

- Set the Thrift `enable_file_scanner_v2` default to `true`, matching
the session default. Preserve explicit `false` for legacy query scans
and extend the existing load-selection test.
- Keep the selected Paimon snapshot and schema together during relation
projection. Historical sequence/aggregation options must not be combined
with the latest field names. Read-only principals can resolve historical
selectors without INSERT permission.
- Read legacy append schemas with missing or empty bucket keys without
bucket pruning, preserving every historical file. The regression covers
both unaware and multiple fixed buckets.

Follow-up validation: 169 targeted Paimon FE tests passed with zero
failures/errors/skips. FE production compilation and Checkstyle passed.
Both changed C++ test translation units passed compiler syntax checks
and clang-format 16. Regenerated Java/C++ defaults are enabled; a Java
8-targeted protocol check verifies constructor/clear defaults, an
omitted wire field, and an explicit-false round trip. Complete BE CI and
live external SQL suites remain pending.

The two new reproductions first failed with the same missing-bucket-key
and renamed-sequence-field errors as CI. A separate read-only-principal
reproduction also failed before the permission correction. Complete
external regression execution remains pending CI.

### BE unit-test compatibility

- Complete the native Arrow Variant input dependency for `branch-4.2`:
accept binary storage and the Parquet Variant extension, validate
metadata and payloads before appending, and retain owned data after
Arrow buffers are released. Allow that ingestion path through the load
reader while preserving query-format restrictions and source-default
validation.
- Preserve Variant V2 markers in the Arrow test fixtures, including
nested types. Verify timestamp input against this branch's SerDe for
positive, negative, and second-boundary values. Match the existing DATE
range diagnostic in the TopN pruning test.
- Add tests for sliced and empty reads, invalid ranges and carriers,
malformed metadata/payloads, NULL children, atomic failure, buffer
ownership, and the query capability boundary.

Validation: all 13 previously failing BE tests passed. The expanded run
passed all 309 tests across nine suites, including Arrow/JSON loads,
load validation, Iceberg, table mapping, and Variant input/output. The
focused executable rebuilds the affected readers and SerDe against
cached 4.2 build dependencies; this is not a complete BE rebuild. All
seven changed C++ translation units passed compiler checks with current
headers/generated Thrift, and all 33 affected C/C++ files passed
clang-format 16. The complete staged diff, whitespace, and
sensitive-information checks passed. Full CI is requested with `run
buildall` and `/review`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.2.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants