Skip to content

[improvement](parquet) Make V2 column initialization lazy#66011

Open
Gabriel39 wants to merge 4 commits into
apache:masterfrom
Gabriel39:agent/parquet-v2-lazy-dictionary-init
Open

[improvement](parquet) Make V2 column initialization lazy#66011
Gabriel39 wants to merge 4 commits into
apache:masterfrom
Gabriel39:agent/parquet-v2-lazy-dictionary-init

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

Proposed changes

  • make File Scanner V2 Parquet column chunk initialization perform no page I/O
  • lazily detect and decode dictionary pages on the first operation that needs page state
  • preserve dictionary initialization before sequential advances and OffsetIndex seeks
  • add regression coverage for zero-I/O initialization, dictionary probing, and indexed page skipping

Test

  • ./run-be-ut.sh --run --filter=ParquetV2NativeDecoderTest.* -j 24 (106 tests passed)
  • build-support/check-format.sh
  • changed-line clang-tidy

@hello-stephen

Copy link
Copy Markdown
Contributor

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

Please clearly describe your PR:

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

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

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

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

------ Round 1 ----------------------------------
============================================
q1	17635	3506	3495	3495
q2	2082	313	194	194
q3	10226	1243	691	691
q4	4721	309	232	232
q5	8098	719	484	484
q6	223	145	110	110
q7	757	702	505	505
q8	10497	1445	1535	1445
q9	4705	3127	3069	3069
q10	6774	1217	998	998
q11	514	324	290	290
q12	777	519	425	425
q13	18027	2362	1896	1896
q14	205	177	179	177
q15	q16	553	502	455	455
q17	1159	1062	875	875
q18	4967	3625	3479	3479
q19	2719	1274	1087	1087
q20	768	657	533	533
q21	5887	2497	2154	2154
q22	414	355	295	295
Total cold run time: 101708 ms
Total hot run time: 22889 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3968	3801	3782	3782
q2	250	256	191	191
q3	2682	2771	2565	2565
q4	1361	1349	1043	1043
q5	2652	2585	2512	2512
q6	228	158	105	105
q7	1281	1140	1089	1089
q8	2001	1729	1704	1704
q9	3727	3677	3615	3615
q10	2441	2438	2150	2150
q11	414	340	312	312
q12	568	546	402	402
q13	2544	2524	1974	1974
q14	248	225	209	209
q15	q16	525	525	450	450
q17	1256	1257	1230	1230
q18	5076	4688	4668	4668
q19	1206	1111	1194	1111
q20	1121	1138	998	998
q21	4404	3733	3789	3733
q22	467	445	398	398
Total cold run time: 38420 ms
Total hot run time: 34241 ms

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Jul 30th, 2026 7:58 AM.
Workflow run: https://github.com/apache/doris/actions/runs/30084479194

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

@hello-stephen

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

query5	4315	555	464	464
query6	452	225	199	199
query7	4859	555	353	353
query8	333	178	171	171
query9	8797	3881	3884	3881
query10	453	343	303	303
query11	5505	1352	1195	1195
query12	157	97	95	95
query13	1293	569	451	451
query14	6075	2860	2629	2629
query14_1	2356	2344	2341	2341
query15	196	149	141	141
query16	1083	547	523	523
query17	1114	603	507	507
query18	2461	443	318	318
query19	217	195	165	165
query20	107	95	92	92
query21	240	146	126	126
query22	7538	7625	7572	7572
query23	9667	9185	8861	8861
query23_1	9175	9017	8997	8997
query24	7293	1378	969	969
query24_1	1007	995	1057	995
query25	544	417	362	362
query26	1330	371	211	211
query27	2545	574	394	394
query28	4423	2176	2178	2176
query29	1138	653	509	509
query30	327	236	198	198
query31	998	658	586	586
query32	116	72	67	67
query33	548	282	260	260
query34	1132	1118	668	668
query35	519	499	455	455
query36	1031	1066	1061	1061
query37	151	101	85	85
query38	1303	1027	962	962
query39	649	647	608	608
query39_1	563	587	610	587
query40	248	164	144	144
query41	63	65	62	62
query42	95	91	97	91
query43	288	285	258	258
query44	1299	779	757	757
query45	131	126	117	117
query46	1004	1166	675	675
query47	1436	1379	1351	1351
query48	414	428	323	323
query49	593	322	237	237
query50	1118	407	338	338
query51	11070	11255	10887	10887
query52	86	88	80	80
query53	264	266	241	241
query54	280	235	218	218
query55	82	72	67	67
query56	272	278	276	276
query57	873	865	810	810
query58	277	259	247	247
query59	1336	1355	1230	1230
query60	315	266	257	257
query61	155	164	152	152
query62	405	294	266	266
query63	231	189	190	189
query64	3538	907	776	776
query65	2133	2063	2058	2058
query66	2232	396	324	324
query67	16127	16101	16037	16037
query68	3017	1519	874	874
query69	420	295	259	259
query70	1110	1056	999	999
query71	386	339	316	316
query72	2924	2421	2328	2328
query73	789	710	449	449
query74	1704	1531	1437	1437
query75	1584	1477	1273	1273
query76	2379	1001	708	708
query77	326	326	264	264
query78	6214	5879	5412	5412
query79	2281	1178	732	732
query80	1720	534	437	437
query81	530	265	225	225
query82	597	141	110	110
query83	356	322	291	291
query84	277	154	130	130
query85	956	577	508	508
query86	421	296	306	296
query87	1152	1087	1052	1052
query88	3795	2900	2902	2900
query89	393	306	273	273
query90	1921	186	189	186
query91	195	195	161	161
query92	62	61	55	55
query93	1741	1395	868	868
query94	737	348	344	344
query95	754	507	543	507
query96	1004	747	364	364
query97	1353	1320	1297	1297
query98	194	171	165	165
query99	594	556	507	507
Total cold run time: 209859 ms
Total hot run time: 117342 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.08	0.04	0.04
query3	0.25	0.12	0.12
query4	1.61	0.13	0.13
query5	0.19	0.17	0.17
query6	1.21	0.96	1.03
query7	0.03	0.00	0.01
query8	0.05	0.03	0.03
query9	0.32	0.25	0.26
query10	0.45	0.43	0.48
query11	0.18	0.13	0.12
query12	0.16	0.12	0.12
query13	0.39	0.38	0.38
query14	0.59	0.58	0.57
query15	0.47	0.46	0.46
query16	0.24	0.26	0.25
query17	0.92	0.91	0.93
query18	0.23	0.22	0.21
query19	1.50	1.42	1.52
query20	0.02	0.02	0.01
query21	15.48	0.19	0.14
query22	4.94	0.05	0.05
query23	16.15	0.31	0.13
query24	2.96	0.39	0.32
query25	0.12	0.08	0.05
query26	0.72	0.21	0.16
query27	0.05	0.04	0.03
query28	3.58	0.77	0.49
query29	12.52	4.26	3.44
query30	0.26	0.16	0.16
query31	2.76	0.49	0.20
query32	3.34	0.41	0.28
query33	1.64	1.65	1.60
query34	15.34	2.66	2.15
query35	2.12	2.14	2.08
query36	0.49	0.34	0.31
query37	0.08	0.05	0.05
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.15	0.11	0.10
query41	0.10	0.03	0.03
query42	0.04	0.02	0.03
query43	0.04	0.04	0.04
Total cold run time: 91.87 s
Total hot run time: 18.48 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 84.00% (21/25) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.10% (24588/42323)
Line Coverage 42.15% (245501/582378)
Region Coverage 38.01% (194774/512434)
Branch Coverage 39.14% (87818/224351)

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.50% (33/40) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.32% (31084/41268)
Line Coverage 59.83% (346134/578506)
Region Coverage 56.50% (290546/514199)
Branch Coverage 57.83% (129763/224381)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17685	3667	3636	3636
q2	2029	294	191	191
q3	10318	1251	763	763
q4	4699	309	225	225
q5	7672	741	468	468
q6	172	144	112	112
q7	716	699	489	489
q8	9883	1504	1581	1504
q9	4678	3046	3092	3046
q10	6749	1162	973	973
q11	514	323	296	296
q12	760	536	434	434
q13	17967	2363	1934	1934
q14	194	187	167	167
q15	q16	544	509	459	459
q17	848	1010	923	923
q18	4985	3800	3488	3488
q19	2006	1140	1040	1040
q20	775	639	566	566
q21	5818	2509	2427	2427
q22	411	354	299	299
Total cold run time: 99423 ms
Total hot run time: 23440 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4109	4000	3970	3970
q2	250	268	189	189
q3	2703	2891	2682	2682
q4	1392	1387	1055	1055
q5	2740	2611	2615	2611
q6	220	152	105	105
q7	1298	1187	1095	1095
q8	2032	1766	1730	1730
q9	3845	3799	3758	3758
q10	2549	2468	2265	2265
q11	412	326	306	306
q12	574	577	424	424
q13	2669	2586	2093	2093
q14	249	215	215	215
q15	q16	520	543	485	485
q17	1255	1252	1248	1248
q18	5183	4911	4755	4755
q19	1170	1151	1174	1151
q20	1149	1132	981	981
q21	4423	3791	3852	3791
q22	478	422	445	422
Total cold run time: 39220 ms
Total hot run time: 35331 ms

@hello-stephen

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

query5	4346	554	440	440
query6	458	223	214	214
query7	4857	592	322	322
query8	338	175	170	170
query9	8764	3929	3951	3929
query10	444	322	280	280
query11	5514	1348	1206	1206
query12	150	95	92	92
query13	1314	596	431	431
query14	6077	2942	2713	2713
query14_1	2439	2426	2451	2426
query15	185	153	140	140
query16	1070	533	512	512
query17	987	578	452	452
query18	2378	426	303	303
query19	215	182	141	141
query20	94	94	90	90
query21	242	144	123	123
query22	7903	7881	7784	7784
query23	9860	9527	9372	9372
query23_1	9389	9456	9310	9310
query24	7282	1353	994	994
query24_1	1043	1010	1022	1010
query25	518	408	368	368
query26	1311	337	226	226
query27	2679	592	363	363
query28	4446	2187	2186	2186
query29	1058	621	482	482
query30	320	221	202	202
query31	927	637	574	574
query32	103	66	64	64
query33	554	297	253	253
query34	1112	1119	623	623
query35	514	531	445	445
query36	1104	1100	1027	1027
query37	156	106	88	88
query38	1288	1030	986	986
query39	637	652	630	630
query39_1	652	596	645	596
query40	265	167	153	153
query41	74	70	69	69
query42	96	99	97	97
query43	293	301	252	252
query44	1338	815	806	806
query45	148	139	131	131
query46	1072	1084	664	664
query47	1463	1418	1427	1418
query48	397	406	325	325
query49	601	332	283	283
query50	1045	413	334	334
query51	10752	10893	11327	10893
query52	90	91	86	86
query53	258	251	201	201
query54	302	251	246	246
query55	81	77	70	70
query56	312	321	305	305
query57	915	925	833	833
query58	299	264	256	256
query59	1445	1463	1342	1342
query60	319	287	266	266
query61	183	185	177	177
query62	414	317	281	281
query63	239	232	193	193
query64	2770	882	745	745
query65	2193	2185	2123	2123
query66	1843	417	328	328
query67	17148	17139	16973	16973
query68	3364	1372	957	957
query69	416	324	272	272
query70	1148	1069	1079	1069
query71	380	337	305	305
query72	2965	2446	2337	2337
query73	802	749	436	436
query74	1805	1675	1531	1531
query75	1650	1529	1329	1329
query76	2343	986	718	718
query77	340	341	281	281
query78	6437	6179	5693	5693
query79	2313	1083	808	808
query80	1477	552	482	482
query81	537	253	225	225
query82	609	145	109	109
query83	379	324	299	299
query84	316	158	130	130
query85	963	560	535	535
query86	452	325	331	325
query87	1207	1143	1079	1079
query88	3947	3033	3031	3031
query89	408	328	283	283
query90	1912	189	188	188
query91	209	202	168	168
query92	64	64	55	55
query93	1676	1428	948	948
query94	725	361	307	307
query95	763	463	423	423
query96	1061	780	353	353
query97	1394	1371	1361	1361
query98	188	180	174	174
query99	626	583	540	540
Total cold run time: 211563 ms
Total hot run time: 120912 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.10	0.05	0.05
query3	0.25	0.13	0.12
query4	1.61	0.13	0.12
query5	0.20	0.18	0.18
query6	1.17	0.98	0.94
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.33	0.27	0.28
query10	0.44	0.45	0.45
query11	0.19	0.12	0.13
query12	0.17	0.12	0.13
query13	0.41	0.39	0.38
query14	0.64	0.60	0.58
query15	0.50	0.48	0.47
query16	0.25	0.24	0.25
query17	1.00	0.96	1.01
query18	0.25	0.24	0.23
query19	1.66	1.51	1.54
query20	0.01	0.01	0.01
query21	15.46	0.25	0.14
query22	4.84	0.05	0.06
query23	16.12	0.33	0.12
query24	3.01	0.45	0.33
query25	0.11	0.05	0.05
query26	0.73	0.19	0.14
query27	0.03	0.04	0.03
query28	3.56	0.82	0.50
query29	12.48	4.40	3.45
query30	0.27	0.15	0.14
query31	2.77	0.51	0.23
query32	3.30	0.39	0.29
query33	1.75	1.69	1.71
query34	15.36	2.83	2.26
query35	2.24	2.24	2.23
query36	0.51	0.33	0.34
query37	0.10	0.05	0.05
query38	0.05	0.04	0.03
query39	0.04	0.03	0.02
query40	0.15	0.12	0.10
query41	0.10	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 92.35 s
Total hot run time: 19.07 s

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Jul 30th, 2026 7:58 AM.
Workflow run: https://github.com/apache/doris/actions/runs/30093252769

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

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 88.57% (31/35) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.06% (24571/42323)
Line Coverage 42.10% (245165/582397)
Region Coverage 37.97% (194600/512449)
Branch Coverage 39.10% (87734/224362)

yiguolei
yiguolei previously approved these changes Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added approved Indicates a PR has been approved by one committer. reviewed labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 88.57% (31/35) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.34% (31090/41268)
Line Coverage 59.87% (346391/578525)
Region Coverage 56.56% (290835/514214)
Branch Coverage 57.98% (130106/224392)

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

Issue Number: None

Related PR: apache#66011

Problem Summary: Lazy dictionary discovery could return before inspecting the first data page. For nested V1 chunks, this allowed an unverified OffsetIndex to skip earlier physical pages and desynchronize logical progress. Continue through the first data-page header before indexed seeking, and add a unit test covering dictionary-prefixed nested V1 pages.

### Release note

None

### Check List (For Author)

- Test: Unit Test
  - ParquetV2NativeDecoderTest.*
- Behavior changed: No
- Does this need documentation: No
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Jul 30th, 2026 7:58 AM.
Workflow run: https://github.com/apache/doris/actions/runs/30128880395

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

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17633	4018	3991	3991
q2	2021	310	204	204
q3	10373	1384	815	815
q4	4681	469	340	340
q5	7542	844	579	579
q6	176	170	135	135
q7	747	807	606	606
q8	10023	1486	1579	1486
q9	6020	4313	4309	4309
q10	6825	1779	1490	1490
q11	510	354	327	327
q12	757	583	449	449
q13	18073	3263	2738	2738
q14	264	256	242	242
q15	q16	786	767	709	709
q17	1046	916	964	916
q18	6996	5873	5466	5466
q19	1174	1256	1088	1088
q20	785	678	568	568
q21	5736	2604	2277	2277
q22	439	348	301	301
Total cold run time: 102607 ms
Total hot run time: 29036 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4349	4313	4274	4274
q2	289	317	212	212
q3	4562	4920	4425	4425
q4	2053	2142	1366	1366
q5	4393	4294	4241	4241
q6	227	177	126	126
q7	1720	1820	1679	1679
q8	2561	2163	2118	2118
q9	7716	7775	7654	7654
q10	4637	4582	4212	4212
q11	572	427	392	392
q12	772	751	540	540
q13	3310	3577	2902	2902
q14	317	310	283	283
q15	q16	748	729	629	629
q17	1360	1292	1316	1292
q18	8102	7396	7133	7133
q19	1104	1073	1062	1062
q20	2203	2197	1954	1954
q21	5194	4540	4365	4365
q22	506	457	393	393
Total cold run time: 56695 ms
Total hot run time: 51252 ms

@hello-stephen

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

query5	4316	624	477	477
query6	461	234	203	203
query7	4837	568	342	342
query8	338	191	171	171
query9	8788	3976	3968	3968
query10	485	343	309	309
query11	5994	2351	2120	2120
query12	170	106	101	101
query13	1267	568	422	422
query14	6233	5165	4858	4858
query14_1	4222	4273	4208	4208
query15	216	198	183	183
query16	984	476	462	462
query17	1040	727	571	571
query18	2460	477	344	344
query19	208	191	157	157
query20	114	107	106	106
query21	233	156	138	138
query22	13562	13498	13270	13270
query23	17244	16366	16062	16062
query23_1	16203	16234	16227	16227
query24	7574	1773	1268	1268
query24_1	1274	1305	1289	1289
query25	571	476	390	390
query26	1361	347	212	212
query27	2616	544	358	358
query28	4450	2008	1956	1956
query29	1059	645	509	509
query30	341	262	234	234
query31	1119	1085	988	988
query32	107	68	62	62
query33	527	326	247	247
query34	1170	1097	660	660
query35	758	783	681	681
query36	1192	1175	1071	1071
query37	152	98	99	98
query38	1863	1708	1654	1654
query39	881	874	851	851
query39_1	822	837	829	829
query40	249	205	144	144
query41	66	63	61	61
query42	91	89	89	89
query43	317	320	279	279
query44	1390	770	747	747
query45	192	179	178	178
query46	1066	1159	752	752
query47	2207	2147	2076	2076
query48	406	380	314	314
query49	611	416	295	295
query50	1092	423	334	334
query51	11008	11134	11036	11036
query52	83	83	77	77
query53	264	267	200	200
query54	274	231	224	224
query55	73	70	64	64
query56	297	297	291	291
query57	1336	1315	1203	1203
query58	276	237	253	237
query59	1560	1576	1402	1402
query60	304	272	247	247
query61	141	150	146	146
query62	537	505	434	434
query63	238	199	193	193
query64	2840	1016	849	849
query65	4699	4601	4628	4601
query66	1817	490	368	368
query67	29147	28560	29028	28560
query68	3287	1544	995	995
query69	402	292	265	265
query70	1053	942	945	942
query71	364	341	301	301
query72	2995	2631	2376	2376
query73	847	761	392	392
query74	5058	4902	4672	4672
query75	2513	2470	2139	2139
query76	2313	1145	757	757
query77	331	377	276	276
query78	11713	12033	11340	11340
query79	1370	1203	755	755
query80	1280	552	458	458
query81	534	335	285	285
query82	592	156	117	117
query83	371	316	292	292
query84	303	156	127	127
query85	955	610	559	559
query86	420	302	249	249
query87	1832	1815	1765	1765
query88	3717	2765	2795	2765
query89	428	381	335	335
query90	1891	200	188	188
query91	198	187	157	157
query92	64	61	56	56
query93	1660	1618	1074	1074
query94	704	326	309	309
query95	776	600	467	467
query96	1066	784	338	338
query97	2651	2641	2492	2492
query98	214	210	211	210
query99	1095	1111	986	986
Total cold run time: 263145 ms
Total hot run time: 177174 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.05	0.06
query3	0.28	0.14	0.14
query4	1.61	0.15	0.14
query5	0.25	0.22	0.22
query6	1.21	1.04	1.04
query7	0.04	0.01	0.00
query8	0.05	0.03	0.04
query9	0.40	0.31	0.31
query10	0.54	0.54	0.54
query11	0.19	0.13	0.15
query12	0.17	0.14	0.15
query13	0.47	0.47	0.47
query14	1.00	1.01	0.99
query15	0.60	0.60	0.60
query16	0.31	0.32	0.31
query17	1.09	1.14	1.07
query18	0.22	0.21	0.22
query19	2.02	1.99	2.02
query20	0.01	0.02	0.01
query21	15.43	0.21	0.13
query22	4.93	0.06	0.05
query23	16.09	0.31	0.12
query24	2.91	0.42	0.32
query25	0.11	0.05	0.05
query26	0.72	0.22	0.14
query27	0.04	0.04	0.03
query28	3.55	0.92	0.53
query29	12.48	4.15	3.30
query30	0.27	0.16	0.15
query31	2.78	0.58	0.31
query32	3.22	0.58	0.49
query33	3.20	3.27	3.17
query34	15.51	4.21	3.50
query35	3.51	3.48	3.50
query36	0.56	0.43	0.43
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.19	0.17	0.15
query41	0.08	0.03	0.03
query42	0.03	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.4 s
Total hot run time: 24.95 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 87.88% (29/33) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.24% (31051/41268)
Line Coverage 59.83% (346149/578523)
Region Coverage 56.62% (291122/514213)
Branch Coverage 57.90% (129926/224392)

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

I found one blocking data-correctness issue and am requesting changes.

Critical checkpoint conclusions:

  • Goal and proof: The PR is intended to make native Parquet column-chunk initialization perform zero page I/O and defer dictionary/page setup. The new read-count tests demonstrate lazy initialization, but the implementation no longer establishes page zero before OffsetIndex row bounds are consumed, so the end-to-end goal is not yet correct.
  • Scope and design: The patch is small and focused, and lazy setup remains inside the native reader boundary. MAIN-1 is a local state-contract regression rather than unrelated scope growth.
  • Concurrency: These reader and cursor fields are single-reader, single-owner scan state; no new thread, lock, atomic, static initialization, or deadlock concern was found.
  • Lifecycle and error handling: Dictionary, auxiliary-page, cache-hit, sequential, EOF, and error propagation paths remain coherent. The blocking lifecycle defect is the first indexed page: reconciliation and chunk-level validation can occur after a caller has already cached or acted on its old row range.
  • Configuration and dynamic behavior: No configuration item is added or changed.
  • Compatibility: No storage format or function-symbol change is introduced. However, malformed but structurally accepted external Parquet OffsetIndexes can now yield shifted rows instead of the previous corruption/fallback behavior, so compatibility-safe error semantics regress.
  • Parallel paths and special conditions: Sequential scalar readers and the levels-only COUNT path parse before use; nested V1 explicitly discards the unsafe index. Flat indexed reads, direct fixed-width filtering, and nested Data Page V2 are covered by MAIN-1 and need the same lazy first-page establishment invariant.
  • Tests and results: The added BE tests cover zero-I/O initialization, dictionary probing, indexed dictionary skipping, and nested-V1 behavior. Existing cardinality tests were changed to call parse_page_header() explicitly, so they do not exercise a first operation that skips page zero or a scalar fallback after index reconciliation. Add those negative cases. I did not run builds or tests in this review-only runner; live PR checks currently report BE UT, compile, formatter, and the other completed suites green.
  • Observability and resources: Existing native-reader statistics, destructor flushing, page-cache accounting, ownership, and retained-scratch behavior remain intact; no separate observability or memory-accounting issue was found.
  • Persistence, transactions, writes, and FE/BE propagation: Not applicable; this patch changes only BE Parquet read-side initialization and tests.
  • Performance: Avoiding page I/O for unused readers is a valid optimization, and the added idempotent check is negligible. Correctness must be restored without giving up zero-I/O init() by lazily establishing the first page before its indexed range is used.
  • Other issues: No additional actionable defect remained after two review rounds and a final full changed-file sweep.

User focus: no additional focus was supplied.

_offset_index = nullptr;
}
}
_dict_checked = true;

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] Establish page zero before consuming its indexed range

With lazy init, a flat reader can cache page_end_row() and decide to skip page 0 before this helper parses its header. That parse may either leave the index active without running ColumnChunkReader::parse_page_header()'s num_values/num_rows checks, or invalidate a physically inconsistent index after the caller has already cached its old row bound.

Both paths can shift rows. Indexed spans [0,2), [2,4), [4,5), [5,6) with physical page counts 1,2,1,2 let a scan selecting [2,4) return physical rows 1-2 as logical rows 2-3. Similarly, spans [0,1), [1,3) with physical counts 2,1 plus a first-rectangle size mismatch switch to sequential end 2, but the caller can still advance using cached end 1 and skip requested row 1. Before this PR, init() established page 0 before any page_end_row() use. Please preserve zero-I/O init(), but lazily reconcile and chunk-validate the first data header before consuming its indexed range, with flat and nested-V2 skip/fallback tests.

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

No new actionable findings at head 94e2d85e5ab65638623aa134fdd74e9eb987e140. The previously reported page-zero OffsetIndex issue is addressed by establishing and validating the first physical data-page header before any indexed range is consumed, while preserving zero-I/O init().

Critical checkpoint conclusions:

  • Goal and proof: The patch makes native Parquet column-chunk initialization perform no page I/O, defers dictionary/header discovery until first use, and preserves page-zero reconciliation before indexed reads, direct fixed-width filtering, nested seeks, and page advances. The added read-count, dictionary, flat fallback/cardinality, and nested V1/V2 tests exercise the intended changed behavior.
  • Scope and design: The change is small and localized to the native Parquet reader state machine and its focused BE tests. Dictionary discovery, chunk-level cardinality validation, and page navigation remain in their owning reader layers.
  • Concurrency: Reader and cursor state remains single-owner scan state. No new threads, locks, atomics, shared mutable globals, static initialization dependency, or deadlock risk is introduced.
  • Lifecycle and error handling: No-dictionary, dictionary-first, auxiliary-page, page-cache, ordinary scalar, direct-filter, nested, levels-only COUNT, EOF, and failed-advance paths were traced. New status-returning calls are checked, successful transitions are idempotent, and wrapper state is committed only after page advance succeeds.
  • Configuration and dynamic behavior: No configuration item is added or changed.
  • Compatibility: No storage format, protocol, function symbol, FE/BE variable, or v1 reader behavior is changed. Active OffsetIndex cardinality checks and conservative sequential fallback remain explicit.
  • Parallel paths and special conditions: Flat required/optional reads, direct fixed-width predicates, nested Page V1/V2, dictionary probing/filtering, auxiliary pages, cached headers, zero-value pages, fully skipped ranges, and levels-only COUNT were reviewed. No changed-path inconsistency remains.
  • Tests and results: The changed BE tests were reviewed for coordinate domains, negative cases, multi-page state, and masking. I did not run builds or tests because this is a review-only runner. Current live checks show formatter, checkstyle, license, dependency, and secret checks passing; BE UT, compile, macOS BE UT, and performance were still pending at the final check.
  • Observability and resources: Existing page/cache/profile counters, buffered I/O ownership, decoder state, and decompression scratch lifetime remain on the same paths; no new memory-accounting or observability gap was found.
  • Persistence, transactions, and writes: Not applicable; this patch changes only BE Parquet read-side initialization and tests.
  • Performance: Delaying the first header/cache/prefetch operation avoids I/O for unused readers, and the one-time lazy checks add negligible work once page state is established.
  • Other issues: A later-page sequential-fallback concern was investigated and dismissed from this review because the authoritative removed code proves the identical behavior existed at the base and this PR neither introduces nor worsens it.

User focus: no additional focus was supplied; the full PR was reviewed and no additional PR-scoped issue was found.

Review status: complete after two convergence rounds, final changed-file and unresolved-candidate sweeps, and live duplicate-state verification.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17588	4048	4027	4027
q2	2006	314	198	198
q3	10382	1408	790	790
q4	4682	469	332	332
q5	7501	844	570	570
q6	182	169	136	136
q7	732	805	606	606
q8	9405	1496	1579	1496
q9	6123	4324	4284	4284
q10	6788	1722	1465	1465
q11	515	353	316	316
q12	717	578	457	457
q13	18107	3245	2730	2730
q14	263	262	247	247
q15	q16	776	765	701	701
q17	1046	1033	1136	1033
q18	7107	5598	5523	5523
q19	1440	1358	1055	1055
q20	804	657	587	587
q21	5960	2598	2438	2438
q22	431	350	293	293
Total cold run time: 102555 ms
Total hot run time: 29284 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4396	4264	4273	4264
q2	282	313	209	209
q3	4560	4897	4328	4328
q4	2062	2137	1329	1329
q5	4370	4236	4212	4212
q6	234	172	124	124
q7	1689	1721	1840	1721
q8	2516	2160	2125	2125
q9	7765	7792	7701	7701
q10	4642	4640	4188	4188
q11	558	417	391	391
q12	762	761	530	530
q13	3379	3743	2971	2971
q14	310	299	272	272
q15	q16	725	801	638	638
q17	1343	1317	1294	1294
q18	8045	7312	6856	6856
q19	1127	1035	1076	1035
q20	2203	2195	1940	1940
q21	5193	4525	4380	4380
q22	513	442	387	387
Total cold run time: 56674 ms
Total hot run time: 50895 ms

@hello-stephen

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

query5	4351	637	489	489
query6	472	233	226	226
query7	4896	606	337	337
query8	342	192	186	186
query9	8772	4017	4042	4017
query10	469	382	319	319
query11	5911	2333	2155	2155
query12	156	103	100	100
query13	1293	653	436	436
query14	6217	5163	4865	4865
query14_1	4208	4221	4233	4221
query15	212	197	178	178
query16	1048	474	438	438
query17	1166	714	573	573
query18	2523	476	355	355
query19	208	195	149	149
query20	110	110	103	103
query21	235	158	137	137
query22	13542	13465	13323	13323
query23	17271	16559	16173	16173
query23_1	16155	16169	16199	16169
query24	8090	1758	1281	1281
query24_1	1310	1286	1311	1286
query25	583	463	382	382
query26	1345	374	221	221
query27	2539	579	379	379
query28	4428	1982	1992	1982
query29	1081	633	491	491
query30	330	268	235	235
query31	1129	1094	982	982
query32	114	67	63	63
query33	551	321	250	250
query34	1188	1143	634	634
query35	761	776	666	666
query36	1167	1172	1066	1066
query37	153	105	92	92
query38	1883	1717	1645	1645
query39	888	892	855	855
query39_1	841	826	855	826
query40	250	165	191	165
query41	63	61	60	60
query42	92	89	90	89
query43	321	324	274	274
query44	1388	761	744	744
query45	201	183	175	175
query46	1025	1191	705	705
query47	2133	2129	2051	2051
query48	400	407	285	285
query49	578	419	304	304
query50	1077	448	318	318
query51	11330	11132	10816	10816
query52	86	85	78	78
query53	261	297	201	201
query54	281	244	205	205
query55	72	68	67	67
query56	307	289	292	289
query57	1330	1304	1207	1207
query58	288	247	264	247
query59	1559	1631	1425	1425
query60	313	263	240	240
query61	162	147	145	145
query62	557	489	429	429
query63	246	207	198	198
query64	2820	1029	874	874
query65	4718	4617	4619	4617
query66	1828	511	377	377
query67	29338	29124	29088	29088
query68	3204	1539	945	945
query69	400	308	265	265
query70	1067	944	931	931
query71	362	332	324	324
query72	3034	2659	1939	1939
query73	813	792	430	430
query74	5081	4912	4689	4689
query75	2538	2477	2131	2131
query76	2317	1158	765	765
query77	341	377	276	276
query78	11796	11746	11384	11384
query79	1471	1129	727	727
query80	1256	559	466	466
query81	531	333	299	299
query82	636	153	125	125
query83	359	332	292	292
query84	277	157	131	131
query85	977	613	541	541
query86	444	284	268	268
query87	1838	1820	1719	1719
query88	3694	2779	2793	2779
query89	443	378	324	324
query90	1859	198	190	190
query91	206	195	165	165
query92	61	60	53	53
query93	1662	1440	1025	1025
query94	731	343	325	325
query95	807	606	493	493
query96	1075	773	346	346
query97	2625	2628	2469	2469
query98	211	211	212	211
query99	1094	1108	972	972
Total cold run time: 264574 ms
Total hot run time: 177346 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.25	0.14	0.14
query4	1.60	0.14	0.14
query5	0.24	0.24	0.22
query6	1.26	1.07	1.08
query7	0.04	0.00	0.00
query8	0.05	0.04	0.04
query9	0.41	0.32	0.32
query10	0.55	0.55	0.54
query11	0.19	0.14	0.13
query12	0.17	0.15	0.14
query13	0.47	0.49	0.48
query14	1.01	1.01	1.00
query15	0.62	0.59	0.59
query16	0.33	0.32	0.31
query17	1.09	1.12	1.10
query18	0.24	0.21	0.21
query19	2.01	1.97	1.95
query20	0.01	0.01	0.02
query21	15.43	0.22	0.13
query22	4.85	0.06	0.05
query23	16.14	0.30	0.11
query24	3.29	0.40	0.35
query25	0.11	0.05	0.04
query26	0.73	0.20	0.14
query27	0.05	0.04	0.03
query28	3.54	1.01	0.55
query29	12.52	4.15	3.33
query30	0.29	0.15	0.15
query31	2.78	0.60	0.32
query32	3.24	0.60	0.48
query33	3.14	3.18	3.21
query34	15.65	4.19	3.53
query35	3.55	3.55	3.51
query36	0.54	0.42	0.41
query37	0.09	0.07	0.07
query38	0.05	0.05	0.04
query39	0.04	0.04	0.03
query40	0.18	0.17	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.04
Total cold run time: 97.01 s
Total hot run time: 25.13 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 91.67% (44/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.05% (24571/42324)
Line Coverage 42.10% (245195/582406)
Region Coverage 37.98% (194626/512450)
Branch Coverage 39.10% (87734/224364)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 91.67% (44/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.22% (31044/41269)
Line Coverage 59.77% (345818/578534)
Region Coverage 56.49% (290495/514215)
Branch Coverage 57.81% (129713/224394)

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66011

Problem Summary: Lazy dictionary discovery could return before inspecting the first data page. For nested V1 chunks, this allowed an unverified OffsetIndex to skip earlier physical pages and desynchronize logical progress. Continue through the first data-page header before indexed seeking, and add a unit test covering dictionary-prefixed nested V1 pages.

### Release note

None

### Check List (For Author)

- Test: Unit Test
  - ParquetV2NativeDecoderTest.*
- Behavior changed: No
- Does this need documentation: No
Lazy column-chunk initialization left OffsetIndex row bounds observable before the first physical page was reconciled and cardinality-checked. Establish page zero on first indexed use and cover flat reads, fixed-width filters, sequential fallback, and nested V2 seeks.
@Gabriel39
Gabriel39 force-pushed the agent/parquet-v2-lazy-dictionary-init branch from 94e2d85 to 6afebd6 Compare July 26, 2026 03:21
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17701	4014	3979	3979
q2	2003	313	197	197
q3	10320	1426	855	855
q4	4680	464	334	334
q5	7536	846	565	565
q6	171	166	135	135
q7	760	837	608	608
q8	9929	1478	1589	1478
q9	6156	4338	4337	4337
q10	6828	1759	1471	1471
q11	514	349	319	319
q12	751	569	455	455
q13	18073	3296	2733	2733
q14	260	263	240	240
q15	q16	779	783	710	710
q17	963	1047	1064	1047
q18	6806	5839	5678	5678
q19	1268	1267	1086	1086
q20	782	664	559	559
q21	5737	2608	2320	2320
q22	424	352	293	293
Total cold run time: 102441 ms
Total hot run time: 29399 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4348	4301	4246	4246
q2	283	318	223	223
q3	4550	4898	4392	4392
q4	2060	2144	1333	1333
q5	4357	4233	4206	4206
q6	222	167	126	126
q7	1722	1887	1750	1750
q8	2490	2139	2166	2139
q9	7809	7769	7635	7635
q10	4646	4580	4174	4174
q11	578	413	391	391
q12	750	746	530	530
q13	3460	3528	2905	2905
q14	306	291	268	268
q15	q16	739	759	640	640
q17	1349	1289	1318	1289
q18	8095	7421	7079	7079
q19	1096	1083	1067	1067
q20	2199	2210	1931	1931
q21	5291	4518	4380	4380
q22	502	442	405	405
Total cold run time: 56852 ms
Total hot run time: 51109 ms

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review conclusion: no new actionable findings at head 6afebd6eabf3c2f2353ec24bd32c5258dce9ef8f; approval opinion.

Critical checkpoint conclusions:

  • Goal and proof: The change makes native Parquet column-chunk initialization perform no page I/O and defers dictionary/page setup until first use. Read-count tests cover the direct chunk and scalar dictionary-probe boundaries, while the added flat/nested tests exercise first-page validation and OffsetIndex fallback.
  • Scope and design: The patch is small and localized to the native Parquet reader state machine and focused BE tests. Dictionary discovery, physical page validation, and typed dictionary ownership remain in their existing reader layers.
  • Concurrency: Reader/page/decoder state is single-owner Row Group scan state. No new threads, locks, atomics, shared mutable globals, static initialization dependencies, or deadlock risks are introduced.
  • Lifecycle and error handling: Dictionary/no-dictionary, auxiliary-page, page-cache-hit, ordinary, fixed-width, dictionary-ID, nested Page V1/V2, levels-only COUNT, EOF, and failed-advance paths were traced. PageReader reconciles physical rectangles before their row end is observed; ColumnChunkReader validates page cardinality before production decode/skip and before indexed advance. New Status results are propagated.
  • Configuration and dynamic behavior: No configuration item is added or changed.
  • Compatibility: No externally consumed ABI/protocol, storage-format contract, FE/BE variable, or v1 reader behavior is changed; the internal native-reader API change has all in-tree callers updated. Optional malformed OffsetIndexes either fall back sequentially or fail on inconsistent cardinality before cursor movement.
  • Parallel paths and special conditions: The previously reported page-zero concern is addressed for ordinary reads, direct fixed-width filtering, indexed advances, nested seeks, and dictionary filtering's two-layer probe/consume path. No parallel-path omission remains.
  • Tests and results: The changed tests cover zero-I/O initialization, lazy dictionary materialization, flat cardinality and rectangle mismatch handling, nested V1/V2 seeking/fallback, auxiliary pages, and malformed page extents. I did not run builds or tests in this review-only runner. The PR body reports 106 native-decoder tests from an earlier patch state; current-head BE UT/compile/performance checks were still pending during review.
  • Observability and resources: Existing page/cache/decompression/dictionary counters and batch/Row Group/destructor flush paths continue to account for the deferred work. Decoder/dictionary/scratch ownership remains reader-scoped; no new memory-accounting issue was found.
  • Persistence, transactions, writes, and FE/BE propagation: Not applicable; this is a BE Parquet read-side initialization change.
  • Performance: Removing first-page I/O from unused reader initialization is a valid optimization; the one-time lazy guards add negligible work and preserve cache/prefetch ownership.
  • Other issues: The only candidate raised during review was dismissed with current-head code evidence after separating lower PageReader rectangle reconciliation from higher ColumnChunkReader cardinality validation.

User focus: no additional focus was supplied; the full PR was reviewed.

Review analysis status: complete after two convergence rounds, final changed-file/unresolved-candidate sweeps, and live head/comment deduplication. The submitted review object will be verified through the PR API immediately after submission.

@hello-stephen

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

query5	4322	621	478	478
query6	457	239	202	202
query7	4829	596	347	347
query8	336	188	169	169
query9	8803	4045	4070	4045
query10	468	350	316	316
query11	5954	2298	2114	2114
query12	187	98	97	97
query13	1241	564	402	402
query14	6223	5163	4846	4846
query14_1	4229	4172	4136	4136
query15	222	204	175	175
query16	981	445	430	430
query17	1087	690	538	538
query18	2452	445	347	347
query19	208	179	143	143
query20	114	104	108	104
query21	233	158	141	141
query22	13548	13481	13272	13272
query23	17429	16424	16105	16105
query23_1	16158	16224	16265	16224
query24	7610	1748	1298	1298
query24_1	1304	1280	1257	1257
query25	569	471	382	382
query26	1369	379	208	208
query27	2542	617	403	403
query28	4482	1994	2000	1994
query29	1124	628	500	500
query30	354	257	224	224
query31	1120	1084	977	977
query32	114	64	61	61
query33	532	323	269	269
query34	1154	1137	673	673
query35	768	784	680	680
query36	1188	1153	1033	1033
query37	150	102	89	89
query38	1863	1701	1620	1620
query39	879	869	862	862
query39_1	835	829	830	829
query40	239	167	147	147
query41	71	70	69	69
query42	94	95	98	95
query43	322	328	276	276
query44	1417	757	763	757
query45	213	193	172	172
query46	1079	1168	708	708
query47	2166	2155	2076	2076
query48	411	421	311	311
query49	589	418	316	316
query50	1030	477	340	340
query51	10909	10991	11072	10991
query52	86	89	76	76
query53	266	294	209	209
query54	311	246	237	237
query55	80	75	67	67
query56	299	336	316	316
query57	1326	1299	1242	1242
query58	319	266	285	266
query59	1571	1653	1409	1409
query60	326	282	267	267
query61	177	198	146	146
query62	541	502	426	426
query63	235	200	198	198
query64	2832	1030	857	857
query65	4734	4668	4596	4596
query66	1832	504	373	373
query67	29203	29186	29012	29012
query68	3254	1482	1006	1006
query69	411	308	262	262
query70	1041	984	975	975
query71	374	330	340	330
query72	3012	2905	2349	2349
query73	833	796	437	437
query74	5015	4900	4710	4710
query75	2515	2493	2146	2146
query76	2311	1144	747	747
query77	344	370	296	296
query78	11746	11880	11277	11277
query79	1377	1176	737	737
query80	1293	558	458	458
query81	553	333	280	280
query82	602	150	119	119
query83	361	318	298	298
query84	291	155	133	133
query85	994	610	519	519
query86	418	289	286	286
query87	1820	1810	1757	1757
query88	3649	2758	2795	2758
query89	433	389	329	329
query90	1928	196	199	196
query91	200	188	166	166
query92	64	62	59	59
query93	1747	1487	997	997
query94	732	337	320	320
query95	791	506	478	478
query96	1047	761	332	332
query97	2641	2627	2517	2517
query98	221	207	199	199
query99	1088	1121	970	970
Total cold run time: 263401 ms
Total hot run time: 177587 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.05	0.06
query3	0.26	0.14	0.13
query4	1.60	0.14	0.13
query5	0.24	0.22	0.21
query6	1.23	1.11	1.04
query7	0.04	0.01	0.01
query8	0.06	0.04	0.03
query9	0.38	0.32	0.31
query10	0.56	0.55	0.53
query11	0.18	0.13	0.14
query12	0.18	0.15	0.13
query13	0.46	0.47	0.47
query14	1.00	1.01	0.99
query15	0.61	0.60	0.59
query16	0.32	0.33	0.31
query17	1.10	1.10	1.09
query18	0.22	0.21	0.21
query19	2.00	1.94	1.90
query20	0.02	0.01	0.01
query21	15.43	0.18	0.15
query22	4.99	0.06	0.05
query23	16.14	0.30	0.13
query24	2.97	0.39	0.30
query25	0.11	0.04	0.04
query26	0.74	0.20	0.15
query27	0.04	0.04	0.04
query28	3.54	0.97	0.53
query29	12.55	4.10	3.26
query30	0.27	0.16	0.15
query31	2.77	0.58	0.31
query32	3.22	0.58	0.48
query33	3.34	3.23	3.20
query34	15.58	4.24	3.55
query35	3.58	3.50	3.51
query36	0.54	0.42	0.43
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.04
query40	0.19	0.16	0.15
query41	0.09	0.03	0.02
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 96.92 s
Total hot run time: 24.89 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 91.67% (44/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.08% (24609/42370)
Line Coverage 42.16% (246017/583490)
Region Coverage 38.04% (195324/513536)
Branch Coverage 39.16% (88131/225039)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 91.67% (44/48) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.85% (30512/41315)
Line Coverage 57.92% (335685/579590)
Region Coverage 54.16% (279088/515289)
Branch Coverage 55.12% (124044/225045)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants