Skip to content

[fix](fe) Avoid OFFSET path and NULL path for complex datatype when its children are accessed.#63229

Merged
englefly merged 9 commits into
apache:masterfrom
englefly:offset-element_at
May 19, 2026
Merged

[fix](fe) Avoid OFFSET path and NULL path for complex datatype when its children are accessed.#63229
englefly merged 9 commits into
apache:masterfrom
englefly:offset-element_at

Conversation

@englefly
Copy link
Copy Markdown
Contributor

@englefly englefly commented May 13, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #62205

Problem Summary: cardinality/map_size on element_at(map, key) was collected as an OFFSET-only access path. element_at(map, key) still needs map keys for lookup, and pushing a nested *.OFFSET predicate path can make BE route OFFSET to an array item child and fail with an invalid access path. Fall back to normal element access for these expressions while preserving OFFSET-only optimization for direct array/map cardinality.

Release note

None

Check List (For Author)

  • Test: Unit Test
    • tools/fast-compile-fe.sh
    • FE_UT_PARALLEL=0 ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testCardinalityMapElementDoesNotUseOffsetPath
    • FE_UT_PARALLEL=0 ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testStructRootMapMixedAccessKeepsKeysPath+testCardinalityMapElementDoesNotUseOffsetPath
    • cd fe && mvn checkstyle:check -pl fe-core -q
    • ./build.sh --fe
  • Behavior changed: No
  • Does this need documentation: No

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: cardinality/map_size on element_at(map, key) was collected as an OFFSET-only access path. element_at(map, key) still needs map keys for lookup, and pushing a nested *.OFFSET predicate path can make BE route OFFSET to an array item child and fail with an invalid access path. Fall back to normal element access for these expressions while preserving OFFSET-only optimization for direct array/map cardinality.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - tools/fast-compile-fe.sh
    - FE_UT_PARALLEL=0 ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testCardinalityMapElementDoesNotUseOffsetPath
    - FE_UT_PARALLEL=0 ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testStructRootMapMixedAccessKeepsKeysPath+testCardinalityMapElementDoesNotUseOffsetPath
    - cd fe && mvn checkstyle:check -pl fe-core -q
    - ./build.sh --fe
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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?

@englefly
Copy link
Copy Markdown
Contributor Author

/review

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17632	4035	3946	3946
q2	q3	10715	869	614	614
q4	4658	455	348	348
q5	7456	1345	1157	1157
q6	192	176	157	157
q7	924	945	767	767
q8	9305	1419	1284	1284
q9	5683	5328	5339	5328
q10	6243	2088	1820	1820
q11	461	269	263	263
q12	624	412	289	289
q13	18093	3326	2786	2786
q14	289	286	268	268
q15	q16	890	853	784	784
q17	985	1043	747	747
q18	6407	5695	5529	5529
q19	1175	1254	1125	1125
q20	524	401	263	263
q21	4531	2430	1972	1972
q22	481	435	324	324
Total cold run time: 97268 ms
Total hot run time: 29771 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4834	4793	5257	4793
q2	q3	4686	4822	4224	4224
q4	2243	2229	1477	1477
q5	5027	5062	5333	5062
q6	211	182	143	143
q7	2066	1786	1614	1614
q8	3394	3117	3139	3117
q9	8398	8548	8474	8474
q10	4506	4507	4273	4273
q11	637	444	429	429
q12	705	745	526	526
q13	3310	3622	2926	2926
q14	310	323	283	283
q15	q16	964	803	678	678
q17	1395	1381	1330	1330
q18	8099	7139	7247	7139
q19	1177	1185	1157	1157
q20	2240	2257	1951	1951
q21	6346	5794	5096	5096
q22	576	540	436	436
Total cold run time: 61124 ms
Total hot run time: 55128 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170352 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 3fe5debf3dc36d70d3a10316bf4cbdc783b388db, data reload: false

query5	4314	661	506	506
query6	325	221	203	203
query7	4215	548	313	313
query8	329	234	221	221
query9	8798	3997	3997	3997
query10	466	345	303	303
query11	5790	2364	2186	2186
query12	181	129	120	120
query13	1288	611	410	410
query14	5955	5354	5054	5054
query14_1	4355	4366	4329	4329
query15	211	205	184	184
query16	1002	462	440	440
query17	1144	783	618	618
query18	2440	480	355	355
query19	219	205	178	178
query20	145	139	133	133
query21	219	141	120	120
query22	13566	13821	14677	13821
query23	17244	16520	16210	16210
query23_1	16344	16386	16303	16303
query24	7414	1777	1340	1340
query24_1	1356	1362	1336	1336
query25	606	512	472	472
query26	1304	320	177	177
query27	2692	550	342	342
query28	4450	1970	1949	1949
query29	1033	652	549	549
query30	306	234	201	201
query31	1101	1067	953	953
query32	97	75	75	75
query33	539	359	298	298
query34	1159	1102	624	624
query35	773	771	672	672
query36	1323	1364	1146	1146
query37	149	102	90	90
query38	3225	3166	3099	3099
query39	932	903	924	903
query39_1	869	854	874	854
query40	234	153	144	144
query41	62	59	61	59
query42	115	106	108	106
query43	323	320	279	279
query44	
query45	211	194	189	189
query46	1084	1204	734	734
query47	2318	2333	2202	2202
query48	414	422	301	301
query49	648	517	448	448
query50	680	280	227	227
query51	4277	4290	4225	4225
query52	108	105	92	92
query53	246	273	198	198
query54	307	274	257	257
query55	92	87	85	85
query56	289	318	314	314
query57	1411	1386	1305	1305
query58	298	277	258	258
query59	1560	1597	1347	1347
query60	353	333	325	325
query61	162	153	155	153
query62	660	618	559	559
query63	236	201	202	201
query64	2514	817	676	676
query65	
query66	1741	516	395	395
query67	30027	29363	29925	29363
query68	
query69	465	342	304	304
query70	1008	973	971	971
query71	311	299	274	274
query72	2919	2671	2505	2505
query73	810	766	423	423
query74	5068	4953	4729	4729
query75	2762	2664	2329	2329
query76	2336	1117	759	759
query77	424	435	345	345
query78	12873	12977	12387	12387
query79	1529	985	735	735
query80	1364	567	501	501
query81	514	283	237	237
query82	1001	157	116	116
query83	354	278	247	247
query84	252	141	107	107
query85	917	499	445	445
query86	454	326	349	326
query87	3403	3372	3208	3208
query88	3529	2677	2645	2645
query89	444	383	337	337
query90	1937	184	172	172
query91	182	172	134	134
query92	76	75	73	73
query93	1208	944	555	555
query94	725	351	297	297
query95	663	478	346	346
query96	1023	781	342	342
query97	2674	2672	2604	2604
query98	233	232	228	228
query99	1125	1109	971	971
Total cold run time: 253811 ms
Total hot run time: 170352 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 40.00% (2/5) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

/review

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions
Copy link
Copy Markdown
Contributor

OpenCode automated review failed and did not complete.

Error: Review step was skipped (possibly timeout or cancelled)
Workflow run: https://github.com/apache/doris/actions/runs/25805360151

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17637	3919	3939	3919
q2	q3	10717	868	649	649
q4	4652	459	355	355
q5	7469	1315	1134	1134
q6	191	171	144	144
q7	902	953	752	752
q8	9296	1387	1252	1252
q9	6030	5354	5306	5306
q10	6316	2139	1802	1802
q11	478	264	260	260
q12	673	413	296	296
q13	18186	3492	2701	2701
q14	287	282	260	260
q15	q16	901	860	778	778
q17	1007	1001	739	739
q18	6484	5569	5648	5569
q19	1307	1328	1080	1080
q20	515	404	255	255
q21	4979	2340	1947	1947
q22	481	385	325	325
Total cold run time: 98508 ms
Total hot run time: 29523 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4638	4554	4544	4544
q2	q3	4663	4748	4207	4207
q4	2140	2179	1422	1422
q5	4994	5012	5286	5012
q6	222	173	134	134
q7	2027	1791	1672	1672
q8	3367	3093	3094	3093
q9	8400	8571	8403	8403
q10	4470	4492	4252	4252
q11	576	419	398	398
q12	694	760	519	519
q13	3214	3580	2924	2924
q14	317	312	291	291
q15	q16	769	797	705	705
q17	1345	1320	1305	1305
q18	7984	7085	7063	7063
q19	1161	1170	1152	1152
q20	2256	2244	1947	1947
q21	6190	5410	5072	5072
q22	520	479	408	408
Total cold run time: 59947 ms
Total hot run time: 54523 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170201 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 338bf528a61228449828028d0375b3e03b2eff4a, data reload: false

query5	4358	673	519	519
query6	338	220	209	209
query7	4220	564	300	300
query8	327	235	224	224
query9	8828	4003	4037	4003
query10	475	350	294	294
query11	5808	2427	2222	2222
query12	179	129	121	121
query13	1299	581	495	495
query14	6315	5311	5025	5025
query14_1	4318	4346	4305	4305
query15	210	204	184	184
query16	1005	458	444	444
query17	1116	744	617	617
query18	2746	481	346	346
query19	218	201	161	161
query20	137	135	129	129
query21	214	137	115	115
query22	13632	13501	13258	13258
query23	17131	16430	16009	16009
query23_1	16131	16179	16196	16179
query24	7576	1751	1341	1341
query24_1	1346	1323	1352	1323
query25	553	494	445	445
query26	1309	327	169	169
query27	2753	615	353	353
query28	4420	1957	1938	1938
query29	998	639	503	503
query30	312	242	208	208
query31	1127	1064	933	933
query32	80	75	78	75
query33	550	357	289	289
query34	1181	1179	655	655
query35	766	795	666	666
query36	1300	1332	1146	1146
query37	156	102	84	84
query38	3196	3140	3035	3035
query39	929	938	922	922
query39_1	886	865	864	864
query40	234	155	139	139
query41	69	75	61	61
query42	109	107	105	105
query43	321	332	293	293
query44	
query45	219	203	198	198
query46	1132	1200	714	714
query47	2299	2376	2270	2270
query48	421	437	305	305
query49	668	549	466	466
query50	705	294	216	216
query51	4366	4258	4297	4258
query52	116	108	99	99
query53	261	292	216	216
query54	338	287	273	273
query55	95	97	91	91
query56	314	357	336	336
query57	1469	1459	1323	1323
query58	314	283	281	281
query59	1582	1592	1371	1371
query60	388	347	333	333
query61	183	184	179	179
query62	694	635	564	564
query63	251	209	212	209
query64	2401	885	741	741
query65	
query66	1758	524	416	416
query67	29917	29891	29850	29850
query68	
query69	468	350	316	316
query70	1018	995	996	995
query71	305	292	278	278
query72	3136	2712	2384	2384
query73	872	722	442	442
query74	5032	4918	4721	4721
query75	2781	2638	2316	2316
query76	2301	1144	753	753
query77	406	412	361	361
query78	13015	12863	12230	12230
query79	1484	992	737	737
query80	1182	586	526	526
query81	495	276	235	235
query82	1318	157	126	126
query83	365	284	249	249
query84	265	144	111	111
query85	917	516	440	440
query86	444	351	331	331
query87	3399	3344	3218	3218
query88	3566	2685	2653	2653
query89	440	382	337	337
query90	1793	181	180	180
query91	178	173	138	138
query92	83	78	74	74
query93	967	961	560	560
query94	608	349	326	326
query95	659	457	341	341
query96	1022	779	343	343
query97	2705	2705	2553	2553
query98	256	233	232	232
query99	1147	1109	982	982
Total cold run time: 254520 ms
Total hot run time: 170201 ms

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking gap in the nested-column pruning fix: the new guard only recognizes a bare ElementAt, so the same invalid *.OFFSET access path can still be produced when the map lookup is wrapped by a transparent cast.

Critical checkpoints: goal is clear and partially achieved for direct cardinality(element_at(map, key))/map_size(element_at(map, key)); implementation is small and focused; no concurrency, lifecycle, configuration, compatibility, transaction, persistence, or FE/BE protocol changes are involved; functionally parallel wrapped-expression paths are not fully covered; test coverage covers direct array/map cases but misses cast/alias wrappers around map element access; no new observability needed.

User focus: no additional user-provided review focus was present.

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 33.33% (2/6) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17686	3871	3882	3871
q2	q3	10718	868	606	606
q4	4659	448	352	352
q5	7457	1311	1135	1135
q6	193	169	136	136
q7	901	951	733	733
q8	9493	1388	1243	1243
q9	5987	5418	5324	5324
q10	6315	2107	1827	1827
q11	481	265	254	254
q12	686	422	299	299
q13	18165	3314	2696	2696
q14	287	282	259	259
q15	q16	895	876	793	793
q17	938	977	702	702
q18	6458	5697	5621	5621
q19	1394	1295	1090	1090
q20	511	390	259	259
q21	4633	2277	1868	1868
q22	412	357	304	304
Total cold run time: 98269 ms
Total hot run time: 29372 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4197	4098	4092	4092
q2	q3	4628	4758	4164	4164
q4	2064	2179	1375	1375
q5	4925	4995	5218	4995
q6	193	163	132	132
q7	2040	1750	2006	1750
q8	3469	3271	3180	3180
q9	8468	8479	8389	8389
q10	4460	4478	4240	4240
q11	593	428	409	409
q12	701	747	563	563
q13	3224	3605	2962	2962
q14	301	315	275	275
q15	q16	776	830	687	687
q17	1329	1312	1247	1247
q18	8221	7225	7033	7033
q19	1112	1132	1155	1132
q20	2233	2234	1947	1947
q21	6078	5433	4876	4876
q22	547	524	431	431
Total cold run time: 59559 ms
Total hot run time: 53879 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 171114 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 3a42147372e5b716c501775404c79cb586e0100f, data reload: false

query5	4307	659	508	508
query6	342	221	197	197
query7	4217	559	295	295
query8	315	234	211	211
query9	8824	3976	4010	3976
query10	465	327	300	300
query11	6013	2404	2229	2229
query12	181	126	138	126
query13	1297	598	415	415
query14	6868	5347	5056	5056
query14_1	4391	4386	4316	4316
query15	222	207	185	185
query16	1010	467	430	430
query17	1397	800	624	624
query18	2759	486	353	353
query19	311	193	162	162
query20	141	130	129	129
query21	214	137	117	117
query22	13582	14055	14476	14055
query23	17316	16474	16163	16163
query23_1	16407	16241	16218	16218
query24	8297	1837	1353	1353
query24_1	1367	1398	1406	1398
query25	553	488	438	438
query26	1144	330	165	165
query27	2657	569	325	325
query28	4306	1912	1916	1912
query29	1003	635	495	495
query30	289	229	193	193
query31	1107	1085	930	930
query32	79	70	71	70
query33	523	353	279	279
query34	1134	1147	628	628
query35	794	776	656	656
query36	1410	1359	1152	1152
query37	146	100	83	83
query38	3208	3099	3075	3075
query39	909	913	876	876
query39_1	898	872	881	872
query40	234	155	134	134
query41	62	60	60	60
query42	109	106	103	103
query43	320	321	282	282
query44	
query45	209	203	190	190
query46	1045	1143	710	710
query47	2295	2283	2188	2188
query48	406	402	294	294
query49	632	522	420	420
query50	710	282	225	225
query51	4312	4250	4257	4250
query52	102	106	102	102
query53	261	275	205	205
query54	311	285	250	250
query55	90	86	81	81
query56	292	308	305	305
query57	1416	1393	1306	1306
query58	307	281	268	268
query59	1596	1579	1379	1379
query60	338	331	311	311
query61	164	159	154	154
query62	671	622	565	565
query63	249	202	210	202
query64	2131	802	678	678
query65	
query66	1634	507	404	404
query67	30128	29248	29716	29248
query68	
query69	463	344	310	310
query70	1057	997	1002	997
query71	303	282	273	273
query72	3181	2909	2633	2633
query73	810	747	433	433
query74	5056	4926	4719	4719
query75	2812	2691	2334	2334
query76	2301	1173	760	760
query77	410	414	341	341
query78	12876	12947	12336	12336
query79	1477	953	712	712
query80	1367	588	486	486
query81	525	284	238	238
query82	948	160	118	118
query83	353	294	266	266
query84	277	142	135	135
query85	894	520	433	433
query86	450	319	308	308
query87	3393	3344	3195	3195
query88	3501	2658	2670	2658
query89	434	384	338	338
query90	1973	183	178	178
query91	182	164	138	138
query92	77	77	71	71
query93	1094	974	576	576
query94	714	341	289	289
query95	673	376	439	376
query96	1026	750	320	320
query97	2699	2701	2573	2573
query98	238	224	249	224
query99	1121	1112	976	976
Total cold run time: 255927 ms
Total hot run time: 171114 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17691	3954	4231	3954
q2	q3	10712	865	605	605
q4	4661	454	349	349
q5	7442	1315	1141	1141
q6	188	168	142	142
q7	908	957	731	731
q8	9563	1425	1244	1244
q9	6332	5393	5320	5320
q10	6330	2072	1809	1809
q11	473	267	257	257
q12	681	413	297	297
q13	18268	3469	2738	2738
q14	300	281	268	268
q15	q16	897	864	796	796
q17	1117	1009	784	784
q18	6460	5616	5569	5569
q19	1675	1267	1080	1080
q20	512	397	258	258
q21	5303	2387	1940	1940
q22	470	384	337	337
Total cold run time: 99983 ms
Total hot run time: 29619 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4733	4595	4616	4595
q2	q3	4650	4773	4209	4209
q4	2132	2181	1415	1415
q5	5005	5071	5266	5071
q6	199	168	140	140
q7	2087	1791	1615	1615
q8	3444	3130	3117	3117
q9	8445	8723	8459	8459
q10	4474	4476	4231	4231
q11	637	424	399	399
q12	719	765	530	530
q13	3257	3603	2899	2899
q14	310	309	273	273
q15	q16	761	807	684	684
q17	1355	1305	1254	1254
q18	8022	7331	7297	7297
q19	1145	1167	1175	1167
q20	2276	2222	1988	1988
q21	6259	5481	4894	4894
q22	514	470	395	395
Total cold run time: 60424 ms
Total hot run time: 54632 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 171088 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 3def0fe48b47678ee4aac89f153ea706c5ce53e9, data reload: false

query5	4347	667	523	523
query6	350	244	211	211
query7	4230	592	306	306
query8	340	242	227	227
query9	8861	4102	4047	4047
query10	459	354	312	312
query11	5795	2426	2180	2180
query12	178	135	132	132
query13	1297	613	451	451
query14	6788	5368	5054	5054
query14_1	4395	4391	4372	4372
query15	217	205	190	190
query16	1007	453	453	453
query17	1376	765	641	641
query18	2763	501	377	377
query19	266	212	169	169
query20	143	135	130	130
query21	219	146	118	118
query22	13681	13589	13330	13330
query23	17227	16491	16034	16034
query23_1	16175	16196	16280	16196
query24	7362	1726	1348	1348
query24_1	1369	1350	1348	1348
query25	559	489	444	444
query26	1168	333	168	168
query27	2644	590	347	347
query28	4342	1969	1942	1942
query29	1003	639	523	523
query30	310	252	201	201
query31	1150	1057	936	936
query32	97	89	87	87
query33	550	362	300	300
query34	1170	1097	641	641
query35	769	806	657	657
query36	1333	1359	1158	1158
query37	160	103	93	93
query38	3216	3125	3043	3043
query39	943	931	880	880
query39_1	879	894	879	879
query40	234	154	139	139
query41	66	62	65	62
query42	113	113	108	108
query43	323	330	297	297
query44	
query45	211	198	198	198
query46	1086	1176	721	721
query47	2293	2380	2157	2157
query48	392	403	302	302
query49	641	533	435	435
query50	712	286	217	217
query51	4276	4364	4283	4283
query52	107	103	101	101
query53	252	271	202	202
query54	330	270	279	270
query55	92	91	84	84
query56	309	301	303	301
query57	1438	1390	1302	1302
query58	305	267	264	264
query59	1550	1642	1486	1486
query60	349	331	324	324
query61	161	155	156	155
query62	677	640	559	559
query63	257	209	201	201
query64	2122	817	691	691
query65	
query66	1640	531	397	397
query67	30360	30002	29832	29832
query68	
query69	444	346	304	304
query70	1000	938	944	938
query71	297	269	279	269
query72	2954	2687	2445	2445
query73	816	768	417	417
query74	5084	4905	4733	4733
query75	2798	2664	2314	2314
query76	2270	1115	769	769
query77	416	416	340	340
query78	12939	12900	12287	12287
query79	1515	986	739	739
query80	1044	590	500	500
query81	507	275	241	241
query82	1344	163	131	131
query83	350	280	253	253
query84	266	145	109	109
query85	953	513	453	453
query86	435	353	315	315
query87	3439	3354	3211	3211
query88	3502	2643	2647	2643
query89	446	387	337	337
query90	1797	179	183	179
query91	181	168	139	139
query92	80	77	77	77
query93	950	941	552	552
query94	659	340	281	281
query95	676	465	344	344
query96	971	766	331	331
query97	2717	2688	2566	2566
query98	246	233	230	230
query99	1119	1118	992	992
Total cold run time: 254547 ms
Total hot run time: 171088 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 78.89% (71/90) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 6.03% (71/1177) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Nested column pruning could leave predicate access paths that were no longer present in all access paths after NULL/OFFSET-only paths were stripped because child data paths covered the same complex container. This broke the assumption that predicate access paths are a subset of all access paths and could make BE enter NULL_MAP_ONLY/OFFSET_ONLY mode while child data still needed to be read. Normalize predicate paths against final all paths and update regression coverage for NULL and OFFSET cases.

### Release note

None

### Check List (For Author)

- Test: Regression test
    - tools/fast-compile-fe.sh fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
    - tools/fast-compile-fe.sh --test fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PruneNestedColumnTest.java
    - ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s null_column_pruning
    - ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s string_length_column_pruning
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@englefly englefly changed the title [fix](fe) Avoid offset path for map element cardinality [fix](fe) Avoid OFFSET path and NULL path for complex datatype when its children are accessed. May 14, 2026
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@englefly
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking correctness issue. The PR improves the nullable/offset path subset handling for mixed projection+predicate cases, but the new predicate filtering still uses the pre-normalized collected paths. That misses the existing map-value offset-only normalization path, so predicateAccessPaths can remain outside allAccessPaths for predicate-only cardinality(map_col['k']) queries.

Critical checkpoint conclusions:

  • Goal/test: The goal is to keep BE-safe all/predicate nested access paths for null and offset pruning. The added tests cover mixed projection+predicate cases, but not predicate-only map element cardinality after special map-path normalization.
  • Scope: The change is mostly focused and localized to Nereids nested-column pruning plus tests.
  • Concurrency/lifecycle/config/compatibility: No new concurrency, special lifecycle, config, storage format, or FE-BE protocol compatibility issue found.
  • Parallel paths: A functionally parallel special path (hasMapValueOffsetOnlyAccess) is not covered by the new subset filtering.
  • Data correctness: Blocking issue below can send BE predicate paths that are not present in the emitted all paths.
  • Tests: Unit/regression coverage was added, but the missing predicate-only map element cardinality case should be covered.
  • Observability/performance: No additional observability or performance concerns found.

User focus: no additional user-provided review focus was specified.

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17638	3838	3805	3805
q2	q3	10722	865	594	594
q4	4665	466	347	347
q5	7472	1359	1134	1134
q6	190	168	137	137
q7	917	931	757	757
q8	9299	1372	1300	1300
q9	5579	5331	5270	5270
q10	6280	2085	1795	1795
q11	472	266	265	265
q12	635	417	292	292
q13	18127	3255	2707	2707
q14	289	285	264	264
q15	q16	895	855	784	784
q17	967	1067	746	746
q18	6463	5773	5592	5592
q19	1246	1283	1013	1013
q20	514	387	265	265
q21	4612	2374	1973	1973
q22	493	430	352	352
Total cold run time: 97475 ms
Total hot run time: 29392 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4774	4708	4854	4708
q2	q3	4655	4766	4192	4192
q4	2134	2167	1413	1413
q5	4981	4933	5173	4933
q6	195	174	138	138
q7	2067	1795	1636	1636
q8	3332	3062	3076	3062
q9	8393	8403	8560	8403
q10	4520	4502	4233	4233
q11	593	407	399	399
q12	701	746	518	518
q13	3219	3597	2984	2984
q14	311	302	277	277
q15	q16	924	784	702	702
q17	1336	1289	1251	1251
q18	7919	7121	7177	7121
q19	1119	1108	1140	1108
q20	2236	2301	1930	1930
q21	6000	5350	4840	4840
q22	552	510	423	423
Total cold run time: 59961 ms
Total hot run time: 54271 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170638 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 a05541e3bd5f76dbc442499938cc3e97c1fb53c9, data reload: false

query5	4322	661	494	494
query6	323	214	192	192
query7	4222	556	324	324
query8	335	233	237	233
query9	8824	3972	3971	3971
query10	448	340	296	296
query11	5766	2387	2194	2194
query12	184	126	128	126
query13	1284	606	459	459
query14	6480	5341	5045	5045
query14_1	4342	4356	4303	4303
query15	209	200	183	183
query16	1010	445	434	434
query17	1112	742	601	601
query18	2519	479	345	345
query19	208	197	158	158
query20	142	136	133	133
query21	208	142	115	115
query22	13716	13971	14665	13971
query23	17453	16467	15989	15989
query23_1	16296	16199	16164	16164
query24	7363	1740	1329	1329
query24_1	1352	1346	1380	1346
query25	620	526	449	449
query26	1315	315	175	175
query27	2703	629	353	353
query28	4425	1949	1949	1949
query29	1015	657	534	534
query30	305	240	196	196
query31	1108	1082	940	940
query32	85	78	73	73
query33	538	368	310	310
query34	1168	1103	643	643
query35	765	774	681	681
query36	1361	1372	1219	1219
query37	156	107	91	91
query38	3184	3125	3036	3036
query39	923	916	878	878
query39_1	856	873	881	873
query40	233	158	137	137
query41	70	66	66	66
query42	112	110	110	110
query43	317	326	281	281
query44	
query45	213	210	201	201
query46	1061	1187	710	710
query47	2349	2316	2175	2175
query48	403	419	293	293
query49	665	541	433	433
query50	714	300	223	223
query51	4280	4190	4290	4190
query52	105	110	96	96
query53	245	284	206	206
query54	353	281	248	248
query55	97	87	87	87
query56	302	306	300	300
query57	1408	1392	1285	1285
query58	287	267	258	258
query59	1546	1624	1407	1407
query60	341	332	312	312
query61	157	153	155	153
query62	683	620	564	564
query63	245	200	206	200
query64	2414	812	680	680
query65	
query66	1718	528	392	392
query67	29981	29838	29803	29803
query68	
query69	459	333	307	307
query70	1023	974	933	933
query71	304	280	267	267
query72	2956	2717	2391	2391
query73	849	798	403	403
query74	5062	4859	4694	4694
query75	2763	2641	2316	2316
query76	2267	1140	757	757
query77	424	424	353	353
query78	12993	13030	12181	12181
query79	1477	1001	721	721
query80	1344	577	471	471
query81	524	284	238	238
query82	1029	160	135	135
query83	381	278	250	250
query84	266	135	109	109
query85	910	501	439	439
query86	465	332	309	309
query87	3406	3331	3226	3226
query88	3550	2673	2651	2651
query89	437	382	332	332
query90	1906	180	182	180
query91	180	163	134	134
query92	79	73	69	69
query93	1069	968	558	558
query94	740	346	300	300
query95	651	471	337	337
query96	1044	753	317	317
query97	2712	2697	2541	2541
query98	238	231	230	230
query99	1120	1112	994	994
Total cold run time: 254463 ms
Total hot run time: 170638 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 81.55% (84/103) 🎉
Increment coverage report
Complete coverage report

englefly and others added 2 commits May 15, 2026 10:13
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: When a field is read in full, NestedColumnPruning could still keep an exact metadata-only path for the same field, such as s.NULL or s.OFFSET. This may route BE iterators into metadata-only mode even though the data path is required.

### Release note

None

### Check List (For Author)

- Test: Regression test / Unit Test
    - tools/fast-compile-fe.sh fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
    - tools/fast-compile-fe.sh --test fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PruneNestedColumnTest.java
    - ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s null_column_pruning -forceGenOut
    - ./run-regression-test.sh --run -d nereids_rules_p0/column_pruning -s string_length_column_pruning -forceGenOut
- Behavior changed: Yes. Metadata-only NULL/OFFSET access paths are removed when the exact field is also read in full.
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Add explanatory comments and examples for NestedColumnPruning helper methods that remove redundant NULL/OFFSET access paths and keep predicate paths consistent with all access paths.

### Release note

None

### Check List (For Author)

- Test: No need to test (comment-only change)
    - cd fe && mvn checkstyle:check -pl fe-core -Dcheckstyle.includes='**/NestedColumnPruning.java'
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17737	3889	3882	3882
q2	q3	10756	1422	859	859
q4	4690	470	346	346
q5	7546	2270	2135	2135
q6	246	182	137	137
q7	951	822	636	636
q8	9356	1730	1601	1601
q9	5163	4956	4903	4903
q10	6407	2065	1782	1782
q11	439	277	249	249
q12	626	435	292	292
q13	18142	3449	2734	2734
q14	259	255	236	236
q15	q16	812	790	706	706
q17	879	898	940	898
q18	7072	5816	5536	5536
q19	1303	1285	1078	1078
q20	524	408	260	260
q21	5822	2491	2463	2463
q22	438	362	299	299
Total cold run time: 99168 ms
Total hot run time: 31032 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4189	4091	4135	4091
q2	q3	4487	4878	4320	4320
q4	2113	2253	1405	1405
q5	4410	4319	4322	4319
q6	235	179	131	131
q7	1965	1988	1729	1729
q8	2711	2167	2194	2167
q9	8053	8114	7872	7872
q10	4513	4462	4052	4052
q11	602	423	369	369
q12	731	773	534	534
q13	3292	3626	2984	2984
q14	302	307	262	262
q15	q16	728	731	645	645
q17	1344	1315	1414	1315
q18	7982	7428	7200	7200
q19	1182	1088	1114	1088
q20	2202	2200	1936	1936
q21	5304	4642	4475	4475
q22	506	467	414	414
Total cold run time: 56851 ms
Total hot run time: 51308 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 169017 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 8c80c3a93f16e83d9acd754d5cd1c438e2906acf, data reload: false

query5	4309	660	527	527
query6	324	224	208	208
query7	4224	614	292	292
query8	336	242	236	236
query9	8823	4075	4051	4051
query10	456	350	300	300
query11	5818	2407	2170	2170
query12	181	129	126	126
query13	1313	597	436	436
query14	6139	5353	5039	5039
query14_1	4394	4382	4347	4347
query15	211	203	185	185
query16	985	493	450	450
query17	1185	741	614	614
query18	2723	510	362	362
query19	229	205	168	168
query20	138	132	133	132
query21	217	148	127	127
query22	13689	13509	13281	13281
query23	17042	16330	16054	16054
query23_1	16146	16118	16244	16118
query24	7453	1787	1310	1310
query24_1	1311	1305	1323	1305
query25	582	496	450	450
query26	1309	324	177	177
query27	2665	563	345	345
query28	4387	1983	2027	1983
query29	1038	650	503	503
query30	312	242	201	201
query31	1115	1072	937	937
query32	92	78	75	75
query33	563	367	310	310
query34	1177	1155	663	663
query35	792	766	676	676
query36	1322	1361	1179	1179
query37	154	99	92	92
query38	3208	3112	3049	3049
query39	929	925	886	886
query39_1	885	884	881	881
query40	233	146	124	124
query41	66	62	67	62
query42	110	109	112	109
query43	335	330	296	296
query44	
query45	208	202	200	200
query46	1070	1156	714	714
query47	2275	2334	2188	2188
query48	399	422	293	293
query49	637	488	377	377
query50	1035	354	256	256
query51	4337	4258	4157	4157
query52	104	107	96	96
query53	254	295	209	209
query54	321	272	253	253
query55	98	95	87	87
query56	327	322	311	311
query57	1428	1375	1324	1324
query58	299	270	263	263
query59	1555	1628	1450	1450
query60	337	330	319	319
query61	164	156	156	156
query62	664	631	567	567
query63	250	209	207	207
query64	2360	789	641	641
query65	
query66	1650	474	357	357
query67	29988	29314	29921	29314
query68	
query69	482	343	307	307
query70	1031	923	969	923
query71	302	276	274	274
query72	3025	2923	2400	2400
query73	814	758	418	418
query74	5057	4907	4743	4743
query75	2677	2601	2261	2261
query76	2296	1167	774	774
query77	416	418	363	363
query78	12268	12113	11596	11596
query79	1441	1030	714	714
query80	734	554	453	453
query81	485	272	238	238
query82	1405	160	123	123
query83	336	281	246	246
query84	269	149	117	117
query85	909	543	448	448
query86	409	334	327	327
query87	3417	3382	3203	3203
query88	3575	2678	2655	2655
query89	451	380	337	337
query90	1890	190	190	190
query91	179	167	136	136
query92	82	78	76	76
query93	1588	1500	886	886
query94	569	364	324	324
query95	656	382	360	360
query96	998	798	324	324
query97	2710	2702	2578	2578
query98	239	227	237	227
query99	1101	1082	961	961
Total cold run time: 253290 ms
Total hot run time: 169017 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 68.67% (114/166) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: apache#63229

Problem Summary: Predicate access path cleanup checked raw allAccessPaths instead of the final paths emitted to BE. When whole-column access collapsed all paths to the root column, redundant child NULL predicate paths could remain and fail nested column pruning invariants.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - FE_UT_PARALLEL=0 ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testProjectFilter
    - FE_UT_PARALLEL=0 ./run-fe-ut.sh --run 'org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testMapElementLengthWithMapValuesKeepsKeysPath+testStructRootMapMixedAccessKeepsKeysPath+testCardinalityMapElementKeepsValueOffsetPath+testCardinalityMapElementOffsetCoveredByValueFieldAccess+testMapElementArrayNullPathCoveredByValueFieldAccess'
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17670	3990	3894	3894
q2	q3	10780	1373	821	821
q4	4681	477	345	345
q5	7653	2228	2127	2127
q6	236	172	137	137
q7	970	798	630	630
q8	9371	1771	1614	1614
q9	5120	4903	4921	4903
q10	6379	2087	1804	1804
q11	434	272	246	246
q12	632	421	289	289
q13	18095	3321	2790	2790
q14	266	256	235	235
q15	q16	821	797	708	708
q17	948	866	963	866
q18	6982	5959	5601	5601
q19	1354	1345	1110	1110
q20	565	559	285	285
q21	6026	2825	2640	2640
q22	457	379	312	312
Total cold run time: 99440 ms
Total hot run time: 31357 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4876	4466	4573	4466
q2	q3	4878	5223	4675	4675
q4	2097	2194	1390	1390
q5	4769	4760	4618	4618
q6	224	174	127	127
q7	1920	1720	1548	1548
q8	2398	2006	1998	1998
q9	7740	7505	7161	7161
q10	4465	4419	4031	4031
q11	532	380	351	351
q12	706	716	510	510
q13	3042	3454	2809	2809
q14	279	269	257	257
q15	q16	689	691	606	606
q17	1259	1226	1222	1222
q18	7378	6794	6656	6656
q19	1100	1078	1067	1067
q20	2214	2250	1949	1949
q21	5281	4544	4439	4439
q22	522	448	405	405
Total cold run time: 56369 ms
Total hot run time: 50285 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 168900 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 55c8428da3e9f32545fccbdb71a5f95db3ae981e, data reload: false

query5	4305	661	516	516
query6	338	213	205	205
query7	4206	589	296	296
query8	333	237	216	216
query9	8831	3983	3988	3983
query10	439	337	301	301
query11	5773	2374	2218	2218
query12	180	143	124	124
query13	1275	621	447	447
query14	6072	5337	5011	5011
query14_1	4340	4338	4321	4321
query15	210	201	181	181
query16	996	456	421	421
query17	1111	715	592	592
query18	2734	485	350	350
query19	212	198	161	161
query20	141	133	137	133
query21	214	139	117	117
query22	13638	13526	13393	13393
query23	17257	16378	16018	16018
query23_1	16243	16121	16198	16121
query24	7579	1781	1287	1287
query24_1	1288	1315	1293	1293
query25	567	509	447	447
query26	1348	324	174	174
query27	2664	571	353	353
query28	4457	1962	1964	1962
query29	1027	627	535	535
query30	313	248	198	198
query31	1135	1077	939	939
query32	94	78	76	76
query33	542	359	312	312
query34	1174	1161	651	651
query35	773	787	687	687
query36	1335	1346	1178	1178
query37	157	107	92	92
query38	3188	3136	3078	3078
query39	949	932	911	911
query39_1	873	895	880	880
query40	228	153	132	132
query41	71	67	67	67
query42	115	112	116	112
query43	328	327	289	289
query44	
query45	217	208	194	194
query46	1087	1204	731	731
query47	2361	2315	2198	2198
query48	423	408	324	324
query49	647	502	398	398
query50	987	367	260	260
query51	4344	4318	4227	4227
query52	112	108	100	100
query53	257	282	208	208
query54	331	290	269	269
query55	96	91	89	89
query56	325	320	319	319
query57	1412	1410	1306	1306
query58	329	286	281	281
query59	1554	1627	1374	1374
query60	342	344	329	329
query61	222	147	156	147
query62	669	636	550	550
query63	247	206	199	199
query64	2366	816	623	623
query65	
query66	1662	478	346	346
query67	30101	29929	29729	29729
query68	
query69	448	336	308	308
query70	1021	1001	962	962
query71	308	276	267	267
query72	2953	2712	2445	2445
query73	816	757	406	406
query74	5099	4878	4700	4700
query75	2674	2585	2275	2275
query76	2328	1133	775	775
query77	400	403	316	316
query78	12141	12080	11745	11745
query79	1439	1070	733	733
query80	676	535	446	446
query81	463	273	239	239
query82	1367	158	124	124
query83	340	287	247	247
query84	263	140	119	119
query85	880	536	486	486
query86	395	350	308	308
query87	3409	3396	3175	3175
query88	3528	2693	2664	2664
query89	461	376	335	335
query90	1896	176	177	176
query91	179	164	146	146
query92	80	78	75	75
query93	1514	1506	852	852
query94	578	344	306	306
query95	646	383	437	383
query96	994	777	339	339
query97	2709	2706	2567	2567
query98	236	233	225	225
query99	1123	1094	993	993
Total cold run time: 253378 ms
Total hot run time: 168900 ms

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Nested column pruning could treat IF result null checks as full branch value access, and whole-column predicate path cleanup could try to mutate an immutable path list. This caused pruning to fail and fallback to the original struct type for mixed IF null-check and child-field predicates.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest#testFilter
    - org.apache.doris.nereids.rules.rewrite.PruneNestedColumnTest
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17887	3872	3909	3872
q2	q3	10767	1345	802	802
q4	4685	462	344	344
q5	7584	2206	2062	2062
q6	237	170	134	134
q7	957	781	642	642
q8	9382	1654	1555	1555
q9	6371	4882	4858	4858
q10	6423	2105	1814	1814
q11	444	280	243	243
q12	683	412	289	289
q13	18288	3497	2759	2759
q14	256	254	235	235
q15	q16	823	770	697	697
q17	912	932	906	906
q18	6903	5782	5500	5500
q19	1238	1329	1028	1028
q20	507	402	262	262
q21	5633	2506	2465	2465
q22	429	344	297	297
Total cold run time: 100409 ms
Total hot run time: 30764 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4185	4084	4072	4072
q2	q3	4410	4882	4277	4277
q4	2089	2185	1353	1353
q5	4358	4267	4250	4250
q6	225	175	128	128
q7	1920	1861	1629	1629
q8	2423	2112	2043	2043
q9	7662	7710	7760	7710
q10	4507	4481	4010	4010
q11	542	411	367	367
q12	716	731	576	576
q13	3387	3647	3000	3000
q14	302	319	287	287
q15	q16	699	745	656	656
q17	1336	1291	1287	1287
q18	7772	7314	7046	7046
q19	1084	1034	1113	1034
q20	2211	2202	1923	1923
q21	5331	4591	4407	4407
q22	514	449	387	387
Total cold run time: 55673 ms
Total hot run time: 50442 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 168514 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 49845488c2e1053b2680c9692cb69cc3154956dc, data reload: false

query5	4335	665	505	505
query6	344	228	197	197
query7	4229	575	309	309
query8	333	227	220	220
query9	8824	3973	3953	3953
query10	449	324	299	299
query11	5846	2402	2188	2188
query12	184	128	129	128
query13	1282	565	406	406
query14	5878	5343	5047	5047
query14_1	4344	4296	4269	4269
query15	210	202	181	181
query16	1086	442	413	413
query17	1166	722	580	580
query18	2648	494	344	344
query19	219	192	156	156
query20	137	130	128	128
query21	217	138	123	123
query22	13551	13471	13222	13222
query23	17239	16375	16124	16124
query23_1	16127	16146	16338	16146
query24	7523	1736	1283	1283
query24_1	1287	1295	1286	1286
query25	551	472	410	410
query26	1322	323	172	172
query27	2704	544	337	337
query28	4435	1949	1945	1945
query29	1026	647	525	525
query30	299	240	200	200
query31	1113	1061	942	942
query32	98	76	77	76
query33	555	355	312	312
query34	1190	1126	644	644
query35	775	784	678	678
query36	1334	1328	1225	1225
query37	161	108	91	91
query38	3246	3147	3037	3037
query39	927	918	900	900
query39_1	893	876	884	876
query40	238	153	131	131
query41	70	69	68	68
query42	115	111	108	108
query43	316	324	284	284
query44	
query45	217	204	194	194
query46	1059	1144	709	709
query47	2353	2348	2245	2245
query48	415	419	310	310
query49	647	508	436	436
query50	965	353	265	265
query51	4290	4294	4229	4229
query52	107	110	94	94
query53	253	283	220	220
query54	382	288	274	274
query55	96	93	86	86
query56	317	335	315	315
query57	1430	1396	1329	1329
query58	325	273	276	273
query59	1601	1608	1369	1369
query60	329	341	330	330
query61	183	177	181	177
query62	685	630	572	572
query63	248	211	207	207
query64	2473	811	647	647
query65	
query66	1708	471	354	354
query67	29844	29876	29696	29696
query68	
query69	461	343	305	305
query70	1022	964	949	949
query71	414	274	264	264
query72	2972	2672	2447	2447
query73	875	752	400	400
query74	5016	4864	4726	4726
query75	2659	2593	2236	2236
query76	2334	1117	767	767
query77	385	399	328	328
query78	12186	12105	11579	11579
query79	1491	998	718	718
query80	1340	530	466	466
query81	502	277	235	235
query82	1310	158	120	120
query83	330	279	245	245
query84	262	136	111	111
query85	934	557	449	449
query86	456	355	310	310
query87	3393	3367	3204	3204
query88	3522	2622	2640	2622
query89	456	381	338	338
query90	1920	180	180	180
query91	179	163	164	163
query92	75	76	75	75
query93	1528	1395	820	820
query94	717	344	307	307
query95	676	395	348	348
query96	1103	765	329	329
query97	2700	2701	2566	2566
query98	232	228	231	228
query99	1122	1102	955	955
Total cold run time: 254266 ms
Total hot run time: 168514 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 43.05% (127/295) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

@englefly englefly merged commit 87d9498 into apache:master May 19, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants