Skip to content

[fix](be) Harden FileScannerV2 schema and reader edge cases#65548

Open
Gabriel39 wants to merge 1 commit into
apache:masterfrom
Gabriel39:codex/fix-file-scanner-v2-review-issues
Open

[fix](be) Harden FileScannerV2 schema and reader edge cases#65548
Gabriel39 wants to merge 1 commit into
apache:masterfrom
Gabriel39:codex/fix-file-scanner-v2-review-issues

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: FileScannerV2 treated valid empty splits as scan failures, localized promoted nested struct predicates with mismatched operand types, retained a process-global Parquet page-cache range index, and rejected whole Parquet schemas when unprojected leaves used unsupported logical types. This change skips and counts empty splits, casts localized nested leaves back to table types, scopes range metadata to each file reader, and defers unsupported-type errors until projection. Regression fixtures and commented examples cover empty CSV input, mixed Parquet struct leaf types, repeated multi-file scans, and an unprojected TIME_MILLIS column.

Release note

Fix FileScannerV2 compatibility for empty files, evolved nested predicates, and Parquet files containing unprojected unsupported columns; reduce Parquet page-cache range-index contention and lifetime.

Check List (For Author)

  • Test: Regression test / Unit Test
    • 55 targeted BE ASAN unit tests
    • test_file_scanner_v2_review_fixes regression suite
  • Behavior changed: Yes (valid empty splits are skipped; unsupported Parquet logical leaves fail only when projected)
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: FileScannerV2 treated valid empty splits as scan failures, localized promoted nested struct predicates with mismatched operand types, retained a process-global Parquet page-cache range index, and rejected whole Parquet schemas when unprojected leaves used unsupported logical types. This change skips and counts empty splits, casts localized nested leaves back to table types, scopes range metadata to each file reader, and defers unsupported-type errors until projection. Regression fixtures and commented examples cover empty CSV input, mixed Parquet struct leaf types, repeated multi-file scans, and an unprojected TIME_MILLIS column.

### Release note

Fix FileScannerV2 compatibility for empty files, evolved nested predicates, and Parquet files containing unprojected unsupported columns; reduce Parquet page-cache range-index contention and lifetime.

### Check List (For Author)

- Test: Regression test / Unit Test
    - 55 targeted BE ASAN unit tests
    - test_file_scanner_v2_review_fixes regression suite
- Behavior changed: Yes (valid empty splits are skipped; unsupported Parquet logical leaves fail only when projected)
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

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

Please clearly describe your PR:

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

@Gabriel39 Gabriel39 marked this pull request as ready for review July 13, 2026 11:34
@Gabriel39 Gabriel39 requested a review from yiguolei as a code owner July 13, 2026 11:34
@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

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

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

------ Round 1 ----------------------------------
============================================
q1	17701	4116	4065	4065
q2	2057	330	206	206
q3	10268	1491	846	846
q4	4684	474	345	345
q5	7599	856	588	588
q6	178	175	135	135
q7	785	859	641	641
q8	9348	1823	1725	1725
q9	5696	4500	4466	4466
q10	6721	1824	1559	1559
q11	508	345	312	312
q12	714	558	416	416
q13	18096	3335	2775	2775
q14	265	260	244	244
q15	q16	793	778	711	711
q17	998	907	1043	907
q18	6966	6002	5579	5579
q19	1309	1208	1084	1084
q20	755	676	596	596
q21	6282	2849	2746	2746
q22	450	376	316	316
Total cold run time: 102173 ms
Total hot run time: 30262 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5120	4803	4763	4763
q2	304	360	221	221
q3	4989	5413	4697	4697
q4	2059	2166	1380	1380
q5	4728	4913	4663	4663
q6	227	179	129	129
q7	1913	1826	1541	1541
q8	2394	2109	2136	2109
q9	7713	7549	7220	7220
q10	4676	4630	4170	4170
q11	521	388	353	353
q12	731	744	531	531
q13	3014	3393	2773	2773
q14	268	273	253	253
q15	q16	678	691	601	601
q17	1269	1250	1250	1250
q18	7453	6938	6977	6938
q19	1111	1063	1102	1063
q20	2212	2224	1926	1926
q21	5238	4508	4418	4418
q22	530	457	416	416
Total cold run time: 57148 ms
Total hot run time: 51415 ms

@hello-stephen

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

query5	4356	634	486	486
query6	446	215	203	203
query7	4849	623	331	331
query8	344	197	174	174
query9	8784	4065	4088	4065
query10	510	335	334	334
query11	5977	2355	2133	2133
query12	168	104	102	102
query13	1252	602	408	408
query14	6220	5228	4946	4946
query14_1	4261	4268	4278	4268
query15	208	203	181	181
query16	1020	485	466	466
query17	1087	740	574	574
query18	2422	462	340	340
query19	207	187	148	148
query20	111	111	115	111
query21	244	160	129	129
query22	13523	13609	13462	13462
query23	17470	16568	16136	16136
query23_1	16307	16293	16273	16273
query24	7575	1804	1331	1331
query24_1	1309	1324	1298	1298
query25	571	473	392	392
query26	1335	345	222	222
query27	2585	627	394	394
query28	4461	2036	2028	2028
query29	1087	646	509	509
query30	337	264	227	227
query31	1131	1094	991	991
query32	122	63	61	61
query33	519	330	257	257
query34	1164	1144	644	644
query35	769	792	673	673
query36	1432	1435	1269	1269
query37	151	106	99	99
query38	1875	1688	1647	1647
query39	918	932	871	871
query39_1	879	887	878	878
query40	248	168	145	145
query41	76	71	70	70
query42	97	98	93	93
query43	318	325	280	280
query44	1437	772	768	768
query45	202	190	180	180
query46	1056	1199	764	764
query47	2455	2432	2283	2283
query48	400	402	316	316
query49	614	439	328	328
query50	1088	429	341	341
query51	10789	10938	10884	10884
query52	89	94	79	79
query53	277	287	213	213
query54	294	248	246	246
query55	82	72	68	68
query56	314	324	302	302
query57	1462	1425	1335	1335
query58	304	274	248	248
query59	1571	1622	1477	1477
query60	334	304	268	268
query61	201	151	150	150
query62	713	653	592	592
query63	236	203	198	198
query64	2854	1066	844	844
query65	4855	4756	4776	4756
query66	1814	513	382	382
query67	29601	29403	29397	29397
query68	2992	1559	1020	1020
query69	405	306	263	263
query70	1064	970	937	937
query71	352	324	299	299
query72	3138	2827	2400	2400
query73	788	825	443	443
query74	5142	4995	4796	4796
query75	2603	2608	2229	2229
query76	2324	1183	792	792
query77	357	379	283	283
query78	12388	12502	11656	11656
query79	1392	1162	762	762
query80	1293	579	474	474
query81	522	318	286	286
query82	630	161	124	124
query83	362	322	294	294
query84	294	164	131	131
query85	971	596	512	512
query86	421	310	253	253
query87	1820	1830	1768	1768
query88	3661	2793	2747	2747
query89	454	407	352	352
query90	1932	201	187	187
query91	202	195	164	164
query92	62	63	59	59
query93	1596	1528	918	918
query94	722	358	329	329
query95	789	596	474	474
query96	1030	860	346	346
query97	2698	2713	2580	2580
query98	227	223	197	197
query99	1162	1177	1021	1021
Total cold run time: 265983 ms
Total hot run time: 180840 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.26	0.14	0.13
query4	1.61	0.14	0.14
query5	0.25	0.25	0.22
query6	1.26	1.08	1.04
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.37	0.31	0.31
query10	0.55	0.54	0.56
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.47	0.47	0.49
query14	1.01	1.00	1.02
query15	0.60	0.59	0.60
query16	0.31	0.32	0.31
query17	1.12	1.10	1.13
query18	0.23	0.21	0.21
query19	2.02	2.03	1.96
query20	0.02	0.01	0.01
query21	15.46	0.23	0.14
query22	4.87	0.06	0.06
query23	16.12	0.31	0.13
query24	3.02	0.44	0.32
query25	0.12	0.04	0.03
query26	0.73	0.22	0.16
query27	0.04	0.04	0.04
query28	3.57	0.89	0.56
query29	12.49	4.08	3.18
query30	0.27	0.15	0.16
query31	2.77	0.61	0.31
query32	3.21	0.59	0.48
query33	3.15	3.29	3.17
query34	15.63	4.23	3.53
query35	3.51	3.52	3.53
query36	0.54	0.43	0.44
query37	0.08	0.06	0.07
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.16	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.67 s
Total hot run time: 24.99 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 67.69% (44/65) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.01% (23635/41458)
Line Coverage 40.68% (231256/568436)
Region Coverage 36.58% (182762/499619)
Branch Coverage 37.69% (81680/216740)

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@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 20th, 2026 12:23 AM.
Workflow run: https://github.com/apache/doris/actions/runs/29255600260

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants