Skip to content

[fix](variant) Read exact sparse cells during path promotion - #70212

Merged
eldenmoon merged 4 commits into
apache:masterfrom
eldenmoon:branch-fix-variant-sparse-promotion-20261104
Nov 6, 2026
Merged

eldenmoon merged 4 commits into
apache:masterfrom
eldenmoon:branch-fix-variant-sparse-promotion-20261104

Conversation

@eldenmoon

@eldenmoon eldenmoon commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: N/A

Related PR: #69995 (found during review; this defect also exists on master), #70060 (independent internal-column-name classification fix)

Problem Summary:

Compaction can promote an ordinary Variant path from sparse storage while its descendants stay sparse. BinaryColumnExtractIterator currently uses the hierarchical VariantAssembler for this physical extraction. A row containing only a.b then becomes a non-null value in the promoted a column as well.

With variant_max_subcolumns_count=1, three input rowsets each materialize a different hot key and leave two scalar a values plus one a.b value sparse. Across the rowsets, a is selected for promotion. Its physical non-null count grows from 6 to 9 and compaction fails with Path stats not match. The failure happens before replacing the input rowsets, so the old data remains readable, but retries with the same selection fail again. This occurs with ordinary keys and does not require dotted-key escaping.

Extract only the exact persisted path using the existing sparse-path binary search and decode_v1_storage_cells. Keep the existing missing/SQL-NULL and present Variant-null semantics, validate offsets before accessing cells, and retain full object payloads stored at the exact path. Hierarchical query assembly continues to use VariantAssembler.

Self-review: the change stays within physical sparse extraction, shared by compaction/checksum readers. Query subtree assembly retains its own assembler. Scratch vectors use Doris memory accounting; borrowed cells are decoded before appending the owning result, and invalid offsets return Corruption before access. No stored-format, protocol, schema, lock, publication or delete-bitmap changes are required. Runtime validation uses a local shared-nothing cluster; cloud callers were checked statically.

Release note

Fix compaction failures when a Variant ancestor path is promoted from sparse storage alongside its descendants.

Check List (For Author)

  • Test:
    • ASAN BE/FE builds passed for the fix. Baseline SQL reproduced the physical 6 -> 9 count mismatch and confirmed that failed compaction leaves the input rowsets readable.
    • Latest focused ASAN BE unit tests: 137 passed, 2 skipped (NestedGroup-dependent tests unavailable in this build). clang-format 16, build hygiene and changed-line clang-tidy passed.
    • sparse_ancestor_promotion, sparse_ancestor_promotion_extended, sparse_key_byte_order and regression_test_query_subcolumns passed in comparison mode. Expectations were generated by the repository runner and independently checked.
    • The original regression suite covers DUP/MOW, segment formats V2/V3, 1/3 sparse shards, two FULL compactions, ordered root/subpath values, and explicit final compaction status.
    • The extension adds only distinct scenarios: a deep path with heterogeneous values through promotion/demotion/promotion; MOW scalar/subtree updates and DELETE; encoded/deep exact paths among byte-order neighbors; and shared-cache transitions between sequential batches and repeated/reordered rowids. It does not duplicate the original format/shard/key-model matrix or ordinary-path unit-test combinations.
    • The extension independently checks 138 ordered row projections, 5 successful FULL compactions and 3 physical layout transitions. Each compaction must replace its input rowsets with a new output.
  • Behavior changed: Yes. Physical sparse extraction no longer synthesizes ancestor values from descendant paths.
  • Does this need documentation: No.

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#69995

Problem Summary: Compaction promotes each physical Variant path independently, but BinaryColumnExtractIterator assembles query subtrees. A sparse row containing only a.b then becomes a non-null a as well. With three rowsets, promotion raises the physical a count from 6 to 9 and fails the path-statistics check before replacing input rowsets. Reuse the existing exact sparse-path binary search and V1 storage-cell decoder so only a persisted value at the requested path is promoted. Preserve missing, Variant-null and exact object payload semantics and reject invalid offsets before accessing cells.

### Release note

Fix compaction failures when a Variant ancestor is promoted from sparse storage alongside its descendants.

### Check List (For Author)

- Test: ASAN BE build; focused BE UT (169 passed, 2 skipped); three targeted regression suites passed; original SQL reproduces 6-to-9 statistics failure and the fixed retry merges four rowsets into one with identical row values, including after an FE/BE restart; clang-format 16, build hygiene and clang-tidy passed.
- Behavior changed: Yes. Physical sparse extraction returns only exact path values.
- Does this need documentation: No.
### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#69995

Problem Summary: Add a discriminating sparse-ancestor promotion test. Three rowsets select different hot leaves at load and promote a common sparse ancestor during compaction. Check final compaction status as well as whole Variant and subpath results, because failed compactions retain readable original rowsets. Cover DUP/MOW tables, V2/V3 segment formats, one/three sparse shards and a second compaction with another sparse source. Add unit coverage for exact cells, descendant-only rows, neighboring keys, exact object payloads, missing and Variant-null values, nested paths, sequential reads and reordered rowid reads. Regression expectations were generated by the repository runner and independently checked row by row.

### Release note

None

### Check List (For Author)

- Test: New ASAN unit test fails on the original code in all four combinations; final focused BE UT has 169 passed and 2 skipped. New regression output generation and comparison passed, including 16 successful FULL compactions; sparse_key_byte_order and regression_test_query_subcolumns also passed. clang-format 16, build hygiene and clang-tidy passed.
- Behavior changed: No.
- 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?

@eldenmoon

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17576	5197	5078	5078
q2	2146	305	245	245
q3	10285	1388	850	850
q4	4675	463	331	331
q5	7428	792	532	532
q6	183	184	153	153
q7	752	789	593	593
q8	9253	1371	1060	1060
q9	5581	4203	4177	4177
q10	6817	1292	1040	1040
q11	430	250	223	223
q12	637	397	274	274
q13	18108	3608	3022	3022
q14	271	276	250	250
q15	q16	754	720	644	644
q17	1199	752	577	577
q18	6988	6174	6132	6132
q19	1233	969	594	594
q20	377	329	225	225
q21	5325	2462	2460	2460
q22	389	327	269	269
Total cold run time: 100407 ms
Total hot run time: 28729 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5978	5928	6069	5928
q2	746	580	581	580
q3	5716	5888	5264	5264
q4	1999	2151	1734	1734
q5	5649	5946	5630	5630
q6	241	192	144	144
q7	2194	1995	1867	1867
q8	3000	2656	2696	2656
q9	8017	7625	7484	7484
q10	3653	3620	3105	3105
q11	596	403	380	380
q12	672	666	511	511
q13	3323	3660	3035	3035
q14	293	291	263	263
q15	q16	661	677	605	605
q17	7783	7026	6928	6928
q18	12968	12196	12804	12196
q19	885	777	761	761
q20	2116	2142	1941	1941
q21	5661	4676	4747	4676
q22	504	443	407	407
Total cold run time: 72655 ms
Total hot run time: 66095 ms

@hello-stephen

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

query5	4318	589	450	450
query6	429	212	197	197
query7	4809	459	226	226
query8	321	166	149	149
query9	8772	3188	3195	3188
query10	495	314	264	264
query11	6088	3847	3569	3569
query12	145	92	89	89
query13	1255	447	329	329
query14	6103	3939	3647	3647
query14_1	3410	3424	3391	3391
query15	206	201	178	178
query16	930	437	415	415
query17	856	645	540	540
query18	2436	427	312	312
query19	200	160	136	136
query20	86	85	83	83
query21	206	127	105	105
query22	13012	12938	12813	12813
query23	13389	12925	12641	12641
query23_1	12502	12497	12510	12497
query24	7380	838	478	478
query24_1	485	492	504	492
query25	536	417	366	366
query26	1285	258	140	140
query27	2766	446	279	279
query28	4632	2022	2055	2022
query29	1602	605	468	468
query30	318	232	184	184
query31	998	926	813	813
query32	143	92	88	88
query33	547	303	247	247
query34	915	856	510	510
query35	751	750	652	652
query36	817	803	716	716
query37	131	105	85	85
query38	1800	1723	1648	1648
query39	807	787	754	754
query39_1	741	732	732	732
query40	222	115	96	96
query41	74	69	68	68
query42	90	86	84	84
query43	343	356	313	313
query44	1329	710	710	710
query45	182	184	170	170
query46	842	1007	559	559
query47	3002	2959	2663	2663
query48	295	300	215	215
query49	574	397	289	289
query50	676	272	205	205
query51	10757	10675	10628	10628
query52	81	81	67	67
query53	181	208	147	147
query54	230	189	176	176
query55	70	65	68	65
query56	224	222	221	221
query57	1647	1650	1555	1555
query58	288	264	252	252
query59	2137	2201	2012	2012
query60	274	245	221	221
query61	145	136	146	136
query62	390	328	281	281
query63	185	156	155	155
query64	2695	938	763	763
query65	3306	3306	3305	3305
query66	1782	426	309	309
query67	20170	20301	20165	20165
query68	3093	1043	623	623
query69	379	286	248	248
query70	817	778	769	769
query71	297	230	214	214
query72	2710	2366	2347	2347
query73	511	519	293	293
query74	4620	4519	4314	4314
query75	2326	2293	1918	1918
query76	2315	1015	594	594
query77	354	361	274	274
query78	9975	9710	9091	9091
query79	1996	855	543	543
query80	1243	427	327	327
query81	607	318	280	280
query82	595	134	106	106
query83	291	203	187	187
query84	313	127	102	102
query85	852	433	368	368
query86	398	235	242	235
query87	1989	1945	1813	1813
query88	3829	2764	2760	2760
query89	330	287	241	241
query90	1858	166	164	164
query91	164	155	128	128
query92	89	88	88	88
query93	1137	1004	583	583
query94	629	306	264	264
query95	566	383	302	302
query96	698	496	248	248
query97	2429	2427	2318	2318
query98	168	157	152	152
query99	787	773	645	645
Total cold run time: 237053 ms
Total hot run time: 151609 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.10	0.10
query5	0.23	0.24	0.24
query6	1.17	0.69	0.67
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.39	0.36	0.37
query10	0.62	0.59	0.60
query11	0.21	0.15	0.14
query12	0.18	0.15	0.15
query13	0.50	0.50	0.51
query14	1.03	1.04	1.01
query15	0.61	0.61	0.63
query16	0.35	0.34	0.33
query17	1.16	1.15	1.15
query18	0.21	0.20	0.20
query19	2.12	1.98	2.00
query20	0.02	0.01	0.01
query21	15.52	0.19	0.13
query22	4.90	0.05	0.05
query23	16.29	0.32	0.13
query24	3.02	0.45	0.38
query25	0.10	0.06	0.05
query26	0.79	0.22	0.16
query27	0.06	0.03	0.04
query28	3.76	0.84	0.36
query29	12.48	4.06	3.21
query30	0.28	0.13	0.10
query31	2.76	0.55	0.32
query32	3.22	0.61	0.50
query33	3.25	3.18	3.19
query34	15.52	4.02	3.36
query35	3.35	3.34	3.35
query36	0.55	0.44	0.43
query37	0.10	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 97.24 s
Total hot run time: 24.34 s

### What problem does this PR solve?

Related PR: apache#70212

Problem Summary: Existing tests cover basic ancestor promotion, but not promotion/demotion/promotion of deep heterogeneous paths, encoded path neighbors, shared-cache read-mode transitions, or updates and deletes after promotion. Add these cases without repeating the existing format/shard/key-model matrix, and verify that compaction replaces the input rowsets.

### Release note

None

### Check List (For Author)

- Test: Focused ASAN BE unit tests; four related regression suites; independently checked 138 projected rows, five compactions and three layouts
- Behavior changed: No
- Does this need documentation: No
@eldenmoon

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17576	5186	5037	5037
q2	2239	306	258	258
q3	10201	1390	805	805
q4	4670	465	339	339
q5	7430	797	536	536
q6	179	180	151	151
q7	746	806	603	603
q8	9263	1322	1047	1047
q9	5415	4183	4181	4181
q10	6817	1300	1030	1030
q11	426	241	231	231
q12	638	399	273	273
q13	18131	3729	3022	3022
q14	281	271	244	244
q15	q16	717	718	675	675
q17	1226	759	573	573
q18	6923	6177	6146	6146
q19	1119	969	594	594
q20	383	341	227	227
q21	5081	2082	2287	2082
q22	354	291	251	251
Total cold run time: 99815 ms
Total hot run time: 28305 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5607	5573	5585	5573
q2	696	577	524	524
q3	5212	5446	4918	4918
q4	1960	2166	1516	1516
q5	5243	5152	5562	5152
q6	276	215	162	162
q7	2387	2140	1901	1901
q8	3013	2642	2956	2642
q9	8056	8145	8126	8126
q10	3743	3665	3258	3258
q11	621	489	409	409
q12	674	677	513	513
q13	3542	4033	3250	3250
q14	323	317	295	295
q15	q16	719	712	663	663
q17	8357	7638	7084	7084
q18	12969	12202	13001	12202
q19	896	771	775	771
q20	2148	2158	1901	1901
q21	5684	4571	4677	4571
q22	488	465	403	403
Total cold run time: 72614 ms
Total hot run time: 65834 ms

@hello-stephen

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

query5	4304	574	447	447
query6	447	201	188	188
query7	4814	433	232	232
query8	354	167	154	154
query9	8789	3213	3192	3192
query10	485	325	260	260
query11	5976	3855	3572	3572
query12	147	86	85	85
query13	1261	446	343	343
query14	6108	4058	3650	3650
query14_1	3437	3437	3427	3427
query15	207	200	188	188
query16	943	422	433	422
query17	871	653	540	540
query18	2415	422	321	321
query19	195	169	135	135
query20	85	82	82	82
query21	208	131	109	109
query22	13006	13106	12768	12768
query23	13532	12785	12394	12394
query23_1	12535	12421	12554	12421
query24	7376	827	478	478
query24_1	507	490	479	479
query25	542	427	372	372
query26	1257	262	141	141
query27	2758	442	281	281
query28	4644	2044	2062	2044
query29	1569	610	468	468
query30	311	224	199	199
query31	1010	935	820	820
query32	150	94	96	94
query33	535	316	249	249
query34	930	856	504	504
query35	742	760	656	656
query36	814	857	721	721
query37	124	98	87	87
query38	1780	1722	1702	1702
query39	810	796	741	741
query39_1	728	733	740	733
query40	226	116	97	97
query41	71	71	68	68
query42	91	85	85	85
query43	351	361	316	316
query44	1331	706	713	706
query45	191	176	172	172
query46	828	979	613	613
query47	2950	2940	2918	2918
query48	293	313	221	221
query49	571	390	293	293
query50	694	284	208	208
query51	10710	10558	10545	10545
query52	80	83	70	70
query53	187	212	155	155
query54	241	189	177	177
query55	77	67	61	61
query56	231	225	206	206
query57	1667	1610	1568	1568
query58	277	259	259	259
query59	2096	2192	2018	2018
query60	287	239	222	222
query61	143	147	149	147
query62	403	340	278	278
query63	192	157	163	157
query64	2734	942	818	818
query65	3328	3281	3281	3281
query66	1778	427	300	300
query67	20252	20069	19969	19969
query68	2945	1016	626	626
query69	389	284	231	231
query70	879	768	787	768
query71	291	236	213	213
query72	2726	2571	2330	2330
query73	532	532	292	292
query74	4634	4555	4347	4347
query75	2324	2300	1916	1916
query76	2324	1013	593	593
query77	341	375	276	276
query78	9761	9730	9138	9138
query79	1034	868	547	547
query80	1258	430	337	337
query81	584	321	269	269
query82	615	131	115	115
query83	314	201	183	183
query84	314	128	105	105
query85	866	439	380	380
query86	398	244	245	244
query87	2008	1941	1824	1824
query88	3879	2786	2779	2779
query89	328	280	243	243
query90	1989	178	173	173
query91	167	155	132	132
query92	102	88	77	77
query93	1060	1037	579	579
query94	660	312	263	263
query95	584	380	310	310
query96	680	491	237	237
query97	2461	2399	2326	2326
query98	164	161	161	161
query99	768	764	653	653
Total cold run time: 236187 ms
Total hot run time: 151679 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.09	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.10
query5	0.23	0.24	0.24
query6	1.18	0.67	0.68
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.39	0.36	0.35
query10	0.59	0.60	0.58
query11	0.20	0.14	0.14
query12	0.18	0.15	0.15
query13	0.51	0.48	0.49
query14	1.03	0.99	1.00
query15	0.62	0.60	0.61
query16	0.34	0.36	0.35
query17	1.17	1.13	1.13
query18	0.21	0.19	0.20
query19	2.14	2.03	2.03
query20	0.02	0.01	0.01
query21	15.48	0.19	0.14
query22	5.01	0.05	0.06
query23	16.28	0.33	0.12
query24	3.03	0.69	0.36
query25	0.12	0.06	0.06
query26	1.39	0.23	0.16
query27	0.06	0.05	0.06
query28	3.42	0.77	0.39
query29	12.51	4.12	3.22
query30	0.28	0.13	0.10
query31	2.77	0.56	0.33
query32	3.22	0.61	0.50
query33	3.18	3.29	3.17
query34	15.43	3.97	3.37
query35	3.34	3.33	3.37
query36	0.55	0.48	0.40
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	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: 97.43 s
Total hot run time: 24.32 s

@eldenmoon

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41832411281

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

@eldenmoon

Copy link
Copy Markdown
Member Author

run buildall

@eldenmoon

Copy link
Copy Markdown
Member Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17616	5161	5071	5071
q2	2120	348	249	249
q3	10233	1465	833	833
q4	4675	465	344	344
q5	7441	793	520	520
q6	186	189	156	156
q7	756	813	603	603
q8	9260	1323	1063	1063
q9	5491	4231	4196	4196
q10	6810	1298	1042	1042
q11	439	243	226	226
q12	636	395	279	279
q13	18137	3592	2999	2999
q14	275	268	238	238
q15	q16	730	713	668	668
q17	1199	753	574	574
q18	7091	6195	6158	6158
q19	1232	979	592	592
q20	395	340	220	220
q21	6051	2464	2417	2417
q22	386	342	274	274
Total cold run time: 101159 ms
Total hot run time: 28722 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5976	5915	6158	5915
q2	716	623	572	572
q3	5684	5805	5311	5311
q4	2046	2131	1565	1565
q5	5708	5786	5647	5647
q6	243	188	141	141
q7	2236	2013	1789	1789
q8	2967	2628	2688	2628
q9	8119	7613	7486	7486
q10	3633	3578	3173	3173
q11	602	410	390	390
q12	656	683	503	503
q13	3308	3563	3055	3055
q14	287	279	266	266
q15	q16	655	681	618	618
q17	7720	7038	6860	6860
q18	12954	12162	12946	12162
q19	889	788	774	774
q20	2135	2142	1914	1914
q21	5545	4559	4670	4559
q22	503	451	400	400
Total cold run time: 72582 ms
Total hot run time: 65728 ms

@hello-stephen

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

query5	4322	573	445	445
query6	427	205	186	186
query7	4802	442	233	233
query8	320	161	157	157
query9	8781	3205	3208	3205
query10	483	308	252	252
query11	6041	3897	3603	3603
query12	148	89	88	88
query13	1262	462	325	325
query14	6113	3946	3647	3647
query14_1	3428	3439	3436	3436
query15	209	200	182	182
query16	942	463	440	440
query17	859	647	544	544
query18	2436	429	320	320
query19	195	162	136	136
query20	84	84	83	83
query21	206	127	108	108
query22	13042	13035	12986	12986
query23	13466	12902	12523	12523
query23_1	12479	12586	12539	12539
query24	7328	814	463	463
query24_1	471	475	473	473
query25	504	392	331	331
query26	1252	253	138	138
query27	2787	431	277	277
query28	4603	2022	2042	2022
query29	1543	571	422	422
query30	298	220	183	183
query31	1003	929	823	823
query32	140	93	100	93
query33	508	293	232	232
query34	907	838	514	514
query35	743	757	631	631
query36	812	856	734	734
query37	123	95	80	80
query38	1772	1730	1666	1666
query39	787	783	741	741
query39_1	725	720	746	720
query40	230	113	91	91
query41	65	65	63	63
query42	87	81	82	81
query43	341	355	304	304
query44	1315	702	702	702
query45	173	174	165	165
query46	829	958	564	564
query47	2952	2938	2759	2759
query48	300	314	221	221
query49	572	395	296	296
query50	663	274	201	201
query51	10471	10652	10386	10386
query52	89	81	69	69
query53	189	207	149	149
query54	255	197	186	186
query55	68	70	63	63
query56	209	213	221	213
query57	1689	1607	1515	1515
query58	283	261	264	261
query59	2177	2167	1945	1945
query60	284	240	222	222
query61	167	142	145	142
query62	379	339	303	303
query63	187	154	155	154
query64	2704	938	730	730
query65	3367	3289	3295	3289
query66	1824	458	301	301
query67	20195	20138	19993	19993
query68	3200	988	612	612
query69	387	281	256	256
query70	851	773	767	767
query71	291	228	207	207
query72	2842	2615	2323	2323
query73	519	530	295	295
query74	4640	4559	4360	4360
query75	2319	2244	1945	1945
query76	2336	999	597	597
query77	342	368	279	279
query78	9605	9624	9217	9217
query79	887	846	535	535
query80	456	430	355	355
query81	509	318	283	283
query82	206	129	107	107
query83	192	194	183	183
query84	279	117	99	99
query85	763	401	355	355
query86	258	241	228	228
query87	1984	1956	1812	1812
query88	3696	2778	2761	2761
query89	313	285	244	244
query90	2095	169	169	169
query91	154	148	125	125
query92	98	86	88	86
query93	976	985	569	569
query94	459	314	269	269
query95	572	327	361	327
query96	680	488	233	233
query97	2437	2437	2340	2340
query98	158	165	144	144
query99	764	758	650	650
Total cold run time: 233407 ms
Total hot run time: 151468 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.10	0.10
query5	0.22	0.24	0.24
query6	1.17	0.67	0.68
query7	0.03	0.01	0.00
query8	0.05	0.04	0.04
query9	0.39	0.35	0.34
query10	0.57	0.56	0.57
query11	0.20	0.15	0.14
query12	0.18	0.16	0.14
query13	0.47	0.50	0.49
query14	1.06	1.00	1.01
query15	0.62	0.62	0.59
query16	0.36	0.34	0.33
query17	1.17	1.10	1.16
query18	0.22	0.19	0.19
query19	2.07	1.98	2.00
query20	0.01	0.01	0.01
query21	15.52	0.20	0.13
query22	4.75	0.05	0.06
query23	16.26	0.33	0.12
query24	2.95	0.51	0.43
query25	0.11	0.06	0.06
query26	1.17	0.23	0.15
query27	0.04	0.05	0.05
query28	3.84	0.80	0.36
query29	12.50	4.15	3.25
query30	0.29	0.13	0.10
query31	2.77	0.56	0.33
query32	3.22	0.61	0.52
query33	3.07	3.28	3.29
query34	15.26	3.99	3.40
query35	3.34	3.34	3.30
query36	0.56	0.43	0.42
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.03	0.02
query42	0.03	0.02	0.02
query43	0.05	0.04	0.04
Total cold run time: 96.92 s
Total hot run time: 24.37 s

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41956865811

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

@eldenmoon

Copy link
Copy Markdown
Member 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.

Static review of head 7de78269c53e33b103d781f955905ee9a35ce040: one new P2 test portability finding, reported inline. No production correctness regression was substantiated. The review converged after two rounds: all three reviewers returned NO_NEW_VALUABLE_FINDINGS in round 2, all six changed files were covered, and every candidate/risk has a verified disposition.

The reviewed invocation flow is:

VariantColumnReader
  compaction/checksum flat leaves -> BinaryColumnExtractIterator -> exact cell -> decode_v1_storage_cells -> writer
  query requiring subtree       -> HierarchicalDataIterator     -> VariantAssembler

Critical checkpoint conclusions:

Checkpoint Conclusion
Goal and evidence Exact-path extraction prevents descendant-only rows from increasing a promoted ancestor's physical non-null count. Added unit/regression cases target that failure.
Scope, clarity and reuse One production implementation changes; it reuses the existing byte-order lower_bound and bounded storage-cell decoder. Other changes are tests/results.
Concurrency and locks No new threads, atomics, locks or lock ordering; scratch state is local and sibling cache consumption remains synchronous.
Lifecycle and static initialization Borrowed cells are decoded into owning columns before a later cache reset. No new static initialization or ownership cycle.
Configuration No new production setting. Temporary regression BE overrides restore saved values in finally.
Compatibility No persisted cell format, metadata layout, function signature, dependency or libc API changes; existing legacy-cell decoding is reused for both segment formats.
Thrift/protobuf No definition, field-id, enum or release-branch compatibility change.
Parallel paths Query prefixes, document subtrees and truncated-stat cases retain hierarchical planning. Compaction/checksum use physical cells; sparse merge retains descendants; local/cloud share the extraction code. M1 concerns the new test's cloud backend selection.
Conditions and error handling Exact equality excludes prefix neighbors. Bad offsets fail before search/access; decode/append statuses propagate. The padded negative offset sentinel is valid.
Test coverage Inspected exact/deep/escaped paths, payload/null/missing cases, reordered/repeated rowids, shared cache transitions, corruption, format/shard/key models, promotion/demotion/repromotion and MOW updates/delete.
Test results Independently reconstructed 560 base and 138 extended projected rows; checked status, row counts and layout transitions. Expectations agree for the intended local layout. M1 makes the tablet-only aggregate nondeterministic when cloud backends cache multiple copies.
Observability Existing read-byte/timing counters and corruption context remain. This local decoding change needs no new background-operation metric.
Transactions, persistence and failover No EditLog, transaction, visibility/version-selection or failover protocol changes.
Writes, atomicity and crash cleanup Decode publishes only a successful owning result; existing compaction rowset replacement, delete bitmaps and cleanup remain downstream.
FE/BE variable passing No new transmitted value or sender path.
Performance and memory Per-row logarithmic lookup avoids descendant decoding/subtree assembly; O(rows) scratch vectors use Doris allocation accounting and shared batch reuse is retained.
Other concerns and user focus No additional user focus was supplied. R1 (caller/path/shard semantics) and R2 (decode/null/ownership/cache semantics) were dismissed with concrete upstream/downstream evidence; no unresolved static review question remains.

M1 is conditional on a supported multi-BE cloud invocation, such as one using enable_cloud_multi_replica; standard cloud_p0 skips nonConcurrent suites, so this is not a claim that its ordinary pipeline fails. Pin the backend across trigger/status/aggregate or explicitly restrict the physical-layout assertion to local mode.

No existing inline threads were present at the final live refresh; there are no existing P0/P1 findings to carry forward. Validation was static only: no builds, tests, formatters, clang-tidy or runtime/ELF checks were executed, and test-output generation provenance was not independently established. No repository source was modified.

Review converged after 2 round(s).

assert after.rowsets.size() == 1 : after
assert after.rowsets.intersect(before.rowsets).isEmpty() : after
qt_output_rows """SELECT count(*), sum(NUM_SEGMENTS), sum(ROWSET_NUM_ROWS)
FROM information_schema.rowsets WHERE TABLET_ID=${tablet.TabletId} AND NUM_SEGMENTS>0"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Scope the rowset aggregate to the checked backend

In a multi-BE cloud compute group with enable_cloud_multi_replica, qt_before can cache the input rowsets on BE B while the full compaction and status checks succeed on BE A. information_schema.rowsets scans every BE's cached tablet map, so this tablet-only aggregate also counts B's stale inputs (or a duplicate refreshed output). The expected 1 / 1 / N result then fails despite successful compaction. Filter by BACKEND_ID for the verified backend and keep that backend pinned across trigger/status checks, or explicitly guard this physical-layout assertion to local mode.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ignore

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.21% (35703/46241)
Line Coverage 62.44% (400295/641117)
Region Coverage 59.05% (338796/573720)
Branch Coverage 60.15% (156869/260810)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.21% (35703/46241)
Line Coverage 62.44% (400298/641117)
Region Coverage 59.07% (338874/573720)
Branch Coverage 60.15% (156869/260810)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.21% (35703/46241)
Line Coverage 62.44% (400311/641117)
Region Coverage 59.10% (339067/573720)
Branch Coverage 60.15% (156874/260810)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.21% (35703/46241)
Line Coverage 62.45% (400354/641117)
Region Coverage 59.10% (339049/573720)
Branch Coverage 60.16% (156891/260810)

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.21% (35703/46241)
Line Coverage 62.45% (400354/641117)
Region Coverage 59.10% (339049/573720)
Branch Coverage 60.16% (156891/260810)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.22% (35706/46241)
Line Coverage 62.46% (400445/641117)
Region Coverage 59.10% (339072/573720)
Branch Coverage 60.16% (156911/260810)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.22% (35706/46241)
Line Coverage 62.46% (400428/641117)
Region Coverage 59.10% (339093/573720)
Branch Coverage 60.17% (156919/260810)

@airborne12 airborne12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@eldenmoon
eldenmoon merged commit 115d5c8 into apache:master Nov 6, 2026
37 checks passed
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 6, 2026
…pe-table

Resolve the sparse extract iterator conflict with apache#70212 by keeping master's
exact sparse cell lookup; that path no longer assembles subtrees, so drop the
iterator's path_encoding parameter. Keep only master's sparse plan sort, which
orders the same encoded storage paths after statistics selection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 6, 2026
Check escaped-table schemas with one PropertyAnalyzer function (no NestedGroup;
predefined templates and index field_pattern must be valid storage paths),
called where the OlapTable is in hand: InternalCatalog.createOlapTable for
CREATE TABLE, CTAS, async MV and LIKE, SchemaChangeHandler for ADD/MODIFY
COLUMN and ADD INDEX, and MaterializedViewHandler for sync MVs. The DDL info
classes are back to their master versions. ALTER and external CREATE TABLE
reject the property through shared helpers.

An async MV must use the same value as its OLAP base tables that have VARIANT
columns: query rewrite replaces base scans with MV scans, and v['a.b'] maps to
different storage paths on legacy and escaped tables. CTAS keeps inheriting
from any escaped source.

Port dotted_key_escape_sparse_promotion, which needed apache#70212, to the table
property. Pin the doc mode and subcolumn defaults in dotted_key_escape_score:
a path that is not materialized scores 0 on both encodings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 6, 2026
…tests

On branch-4.x, casting Variant(max_subcolumns=0) from parse_to_variant
into a column typed Variant(max_subcolumns=1) is rejected. Insert JSON
strings instead so the cast uses the target column type, keeping the
compaction sparse-ancestor promotion coverage from apache#70212.
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 6, 2026
…tests

On branch-4.x, casting Variant(max_subcolumns=0) from parse_to_variant
into a column typed Variant(max_subcolumns=1) is rejected. Insert JSON
strings instead so the cast uses the target column type, keeping the
compaction sparse-ancestor promotion coverage from apache#70212.
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 7, 2026
… inserts

1) schema_change .out: nested commit.distinct is true/false on branch-4.x
   (public remains 1).
2) var_index_snii: avoid parse_to_variant → typed Variant cast which branch-4.x
   rejects (Variant(0)→Variant(9)); insert JSON strings instead, same pattern
   as the apache#70212 sparse_ancestor pick fix.
xylaaaaa pushed a commit to xylaaaaa/doris that referenced this pull request Nov 9, 2026
### What problem does this PR solve?

Related PR: apache#69082

Problem Summary: Public URL generation assumed an S3 client whenever an
endpoint matched the OSS private endpoint suffix. A custom Azure endpoint
with that suffix would fail before signing. Rewrite the endpoint in a
copy of the configured backend so its own client signs the public URL.

### Release note

None

### Check List (For Author)

- Test: FE and ASAN BE builds passed. The file system and regression
  test compiled. The macOS BE UT target stopped at the pre-existing
  std::min type mismatch in binary_column_extract_iterator_test.cpp:74
  from apache#70212. Header hygiene, clang-format 16 and clang-tidy passed.
- Behavior changed: No (restores pre-refactor public URL generation).
- Does this need documentation: No
xylaaaaa pushed a commit to xylaaaaa/doris that referenced this pull request Nov 9, 2026
### What problem does this PR solve?

Related PR: apache#69082

Problem Summary: When credentials were refreshed while a writer waited
for its parts, CompleteMultipartUpload used the replacement client.
Remember the holder state before waiting. After all upload callbacks
finish, reject an invalidated holder and keep the original client
when only authentication changed. Other configuration updates and
resource backend rebinds still use the current client.

### Release note

None

### Check List (For Author)

- Test: ASAN BE and FE builds passed. The new writer test compiled.
  The macOS BE UT target still stops in the upstream segment test
  binary_column_extract_iterator_test.cpp:74 (apache#70212), before test
  execution. Header hygiene, clang-format 16 and clang-tidy passed.
- Behavior changed: No (restores pre-refactor credential rotation).
- Does this need documentation: No
yiguolei pushed a commit that referenced this pull request Nov 10, 2026
…ion (#70355)

cherry-pick #70212

Conflicts resolved: kept branch-4.1 exact-match _fill_variant_v2_path
(already equivalent to the master fix; release branch still has dual
V1/V2 API) and added intent comment. Adapted new BE UTs to
ColumnVariant::create_binary_column_fn / StorageReadOptions.stats /
use_variant_v2=true. BinaryColumnExtractIteratorV2Test: 13/13 passed
locally.
yiguolei pushed a commit that referenced this pull request Nov 10, 2026
…ion (#70356)

cherry-pick #70212

Conflicts resolved: kept branch-4.2 exact-match _fill_variant_v2_path
(already equivalent; dual V1/V2 API) and added intent comment. Adapted
new BE UTs to branch APIs (ColumnVariant::create_binary_column_fn /
StorageReadOptions.stats / use_variant_v2=true). BE UT left to CI
(branch-4.2 full UT build known lance_reader issue); same adaptations
validated via branch-4.1 UT run.
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Nov 12, 2026
… inserts

1) schema_change .out: nested commit.distinct is true/false on branch-4.x
   (public remains 1).
2) var_index_snii: avoid parse_to_variant → typed Variant cast which branch-4.x
   rejects (Variant(0)→Variant(9)); insert JSON strings instead, same pattern
   as the apache#70212 sparse_ancestor pick fix.
yiguolei pushed a commit to eldenmoon/incubator-doris that referenced this pull request Nov 13, 2026
… inserts

1) schema_change .out: nested commit.distinct is true/false on branch-4.x
   (public remains 1).
2) var_index_snii: avoid parse_to_variant → typed Variant cast which branch-4.x
   rejects (Variant(0)→Variant(9)); insert JSON strings instead, same pattern
   as the apache#70212 sparse_ancestor pick fix.
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.

4 participants