Skip to content

[feature](variant) Enable Variant V2 by default - #66858

Draft
eldenmoon wants to merge 12 commits into
apache:masterfrom
eldenmoon:branch-variant-v2-default-on
Draft

[feature](variant) Enable Variant V2 by default#66858
eldenmoon wants to merge 12 commits into
apache:masterfrom
eldenmoon:branch-variant-v2-default-on

Conversation

@eldenmoon

@eldenmooneldenmoon commented Aug 18, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: None

Related PR: #66204

Problem Summary: ColumnVariantV2 is implemented in master but remains opt-in through Config.enable_variant_v2, so normal Variant planning and storage continue to select the legacy path. Make the existing V2 path the default while preserving enable_variant_v2=false as an explicit fallback.

Enabling V2 by default exposed regression cases that assumed legacy implicit string-to-Variant assignment or legacy output representation. Update those cases following variant_p0 conventions: construct V2 values with parse_to_variant and normalize only representation-dependent expectations. Production Cast behavior is unchanged. Keep the hierarchical iterator test portable across standard library implementations.

Release note

Enable ColumnVariantV2 by default for Variant execution and storage. The legacy path remains available with enable_variant_v2=false.

Check List (For Author)

  • Test:
    • Rebased onto master 5870fb2
    • Full ASAN BE and FE build with ./build.sh --be --fe, without -j
    • Focused regression tests for the original affected suites: 24/24 passed
    • Newly reported regression groups passed with V2 enabled: fault injection 3/3, variant_p0/with_index 8/8, inverted-index insert 1/1, remote Doris 2/2
    • The same newly reported groups passed with enable_variant_v2=false
    • FE VariantEqualityContextTest: 3/3 passed
    • FE ConfigTest: 7/7 passed
    • BE focused tests: 78/78 passed
    • Regression test compile, clang-format, check-format, and git diff --check
  • Behavior changed: Yes (ColumnVariantV2 is enabled by default; explicit false remains supported; V2 does not add legacy implicit Cast behavior)
  • 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
MemberAuthor

run buildall

1 similar comment
@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 16987 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 3e2ed7f8d70dfafa0c52e9fc89ebf37c94c0dfb2, 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	17559	2991	2988	2988
q2	q3	10862	902	501	501
q4	4675	254	206	206
q5	7667	588	400	400
q6	139	115	99	99
q7	533	510	394	394
q8	9265	874	891	874
q9	3449	2391	2343	2343
q10	6529	879	720	720
q11	443	256	240	240
q12	696	395	346	346
q13	17856	1543	1161	1161
q14	161	145	139	139
q15	q16	476	408	370	370
q17	831	816	821	816
q18	3140	2289	2234	2234
q19	1118	846	775	775
q20	722	546	483	483
q21	5314	1669	1959	1669
q22	327	270	229	229
Total cold run time: 91762 ms
Total hot run time: 16987 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	3351	3312	3310	3310
q2	q3	2185	2345	2084	2084
q4	1202	1166	869	869
q5	2163	2109	2114	2109
q6	176	114	88	88
q7	1041	923	851	851
q8	1587	1400	1400	1400
q9	3130	3090	3071	3071
q10	1857	1776	1604	1604
q11	360	275	257	257
q12	450	431	335	335
q13	1480	1534	1149	1149
q14	164	167	164	164
q15	q16	402	394	359	359
q17	1040	1019	1018	1018
q18	4973	4429	4758	4429
q19	1251	849	835	835
q20	949	954	793	793
q21	3506	3218	3208	3208
q22	398	338	320	320
Total cold run time: 31665 ms
Total hot run time: 28253 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 81251 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 3e2ed7f8d70dfafa0c52e9fc89ebf37c94c0dfb2, data reload: false
query5	4283	424	339	339
query6	393	173	146	146
query7	4869	447	267	267
query8	303	126	122	122
query9	8696	2893	2901	2893
query10	414	255	208	208
query11	5366	1027	910	910
query12	111	71	70	70
query13	1202	460	329	329
query14	6155	2233	2104	2104
query14_1	1994	1978	1965	1965
query15	172	114	110	110
query16	917	377	358	358
query17	818	452	367	367
query18	2334	336	236	236
query19	170	142	118	118
query20	71	71	71	71
query21	209	114	101	101
query22	5409	5408	5261	5261
query23	6740	6229	5974	5974
query23_1	6098	6100	6078	6078
query24	7350	1109	730	730
query24_1	782	774	783	774
query25	433	310	265	265
query26	1239	268	169	169
query27	2719	449	286	286
query28	4590	1515	1487	1487
query29	958	422	346	346
query30	273	174	147	147
query31	844	433	349	349
query32	92	49	47	47
query33	468	215	178	178
query34	973	811	497	497
query35	406	387	339	339
query36	553	551	513	513
query37	116	76	68	68
query38	1008	846	819	819
query39	499	485	473	473
query39_1	468	433	457	433
query40	217	119	106	106
query41	52	49	51	49
query42	81	78	71	71
query43	237	238	208	208
query44 query45	105	106	96	96
query46	758	842	542	542
query47	768	759	719	719
query48	323	294	240	240
query49	544	233	194	194
query50	806	320	255	255
query51	8034	7866	7896	7866
query52	72	77	73	73
query53	195	210	162	162
query54	236	175	162	162
query55	73	62	55	55
query56	224	237	235	235
query57	707	765	671	671
query58	239	193	197	193
query59	1256	1223	1061	1061
query60	269	223	189	189
query61	119	128	140	128
query62	371	208	183	183
query63	182	170	163	163
query64	2788	729	593	593
query65 query66	2001	328	275	275
query67	9981	11176	10498	10498
query68 query69	390	218	203	203
query70	644	595	641	595
query71	304	243	250	243
query72	2493	1935	1702	1702
query73	660	609	349	349
query74	1956	1274	1189	1189
query75	1285	1169	1046	1046
query76	2473	727	561	561
query77	246	274	213	213
query78	4120	3718	3308	3308
query79	3333	762	602	602
query80	1687	418	352	352
query81	539	199	192	192
query82	948	128	104	104
query83	324	265	244	244
query84 query85	977	434	378	378
query86	494	176	172	172
query87	1034	987	911	911
query88	4390	2186	2164	2164
query89	284	224	201	201
query90	2112	141	141	141
query91	168	138	121	121
query92	62	44	46	44
query93	3011	1102	770	770
query94	670	241	222	222
query95	640	364	346	346
query96	769	587	277	277
query97	1100	1097	1042	1042
query98	186	138	137	137
query99	448	348	317	317
Total cold run time: 178294 ms
Total hot run time: 81251 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage75.69% (34074/45016)
Line Coverage60.58% (383247/632662)
Region Coverage56.77% (321701/566724)
Branch Coverage57.61% (146688/254608)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@eldenmoon
eldenmoonforce-pushed the branch-variant-v2-default-on branch from 3e2ed7f to 488ebeaCompareAugust 18, 2026 10:44
@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@eldenmoon
eldenmoonforce-pushed the branch-variant-v2-default-on branch from 488ebea to 2ab8c68CompareAugust 18, 2026 12:44
@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 17509 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 488ebea9f93b8b8ec43875b418875709d46a1b92, data reload: false
------ Round 1 ----------------------------------
============================================
q1	17592	3140	3146	3140
q2	2027	230	152	152
q3	10328	860	507	507
q4	4672	246	202	202
q5	7714	575	384	384
q6	138	116	95	95
q7	528	520	406	406
q8	9262	952	944	944
q9	3453	2416	2383	2383
q10	6503	873	745	745
q11	456	258	247	247
q12	682	400	334	334
q13	17876	1539	1157	1157
q14	164	145	139	139
q15	q16	432	392	363	363
q17	752	809	796	796
q18	3088	2286	2248	2248
q19	1125	837	790	790
q20	651	522	459	459
q21	5328	1787	1960	1787
q22	334	271	231	231
Total cold run time: 93105 ms
Total hot run time: 17509 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3499	3427	3420	3420
q2	214	225	161	161
q3	2154	2339	2167	2167
q4	1221	1181	902	902
q5	2171	2143	2096	2096
q6	181	120	87	87
q7	1038	888	862	862
q8	1654	1445	1446	1445
q9	3186	3109	3154	3109
q10	1865	1778	1613	1613
q11	365	280	257	257
q12	455	426	341	341
q13	1490	1532	1172	1172
q14	182	176	161	161
q15	q16	394	404	352	352
q17	1073	1052	1057	1052
q18	4991	4389	4748	4389
q19	893	865	867	865
q20	976	943	823	823
q21	3747	3151	3300	3151
q22	403	355	319	319
Total cold run time: 32152 ms
Total hot run time: 28744 ms

@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 83404 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 488ebea9f93b8b8ec43875b418875709d46a1b92, data reload: false
query5	4282	419	339	339
query6	404	163	157	157
query7	4871	454	274	274
query8	302	132	122	122
query9	8721	2936	2942	2936
query10	383	251	246	246
query11	5369	1047	945	945
query12	114	72	71	71
query13	1191	439	317	317
query14	6128	2224	2119	2119
query14_1	2011	1999	1985	1985
query15	176	122	113	113
query16	917	371	367	367
query17	797	461	381	381
query18	2333	325	241	241
query19	163	148	116	116
query20	71	72	71	71
query21	215	121	103	103
query22	5321	5249	5314	5249
query23	6698	6173	5982	5982
query23_1	6095	5970	6031	5970
query24	7338	1105	765	765
query24_1	755	766	773	766
query25	417	281	232	232
query26	1253	264	163	163
query27	2706	430	264	264
query28	4661	1516	1513	1513
query29	918	416	338	338
query30	280	169	152	152
query31	847	433	350	350
query32	98	49	47	47
query33	458	209	173	173
query34	990	851	489	489
query35	398	399	346	346
query36	555	565	526	526
query37	122	89	70	70
query38	998	844	800	800
query39	507	453	494	453
query39_1	469	474	454	454
query40	217	122	110	110
query41	52	52	54	52
query42	80	79	78	78
query43	243	251	219	219
query44	1036	559	578	559
query45	113	107	96	96
query46	773	848	545	545
query47	767	751	712	712
query48	319	324	232	232
query49	542	249	205	205
query50	862	337	274	274
query51	8187	8024	8135	8024
query52	79	75	61	61
query53	207	236	193	193
query54	223	173	167	167
query55	78	63	64	63
query56	225	213	213	213
query57	665	638	666	638
query58	263	184	176	176
query59	1227	1277	1098	1098
query60	275	206	193	193
query61	137	137	132	132
query62	357	243	187	187
query63	179	153	158	153
query64	2857	672	589	589
query65	1637	1598	1527	1527
query66	1958	307	243	243
query67	9824	9814	9731	9731
query68	2794	1194	758	758
query69	338	229	199	199
query70	687	632	612	612
query71	275	244	253	244
query72	2297	1800	1697	1697
query73	653	607	339	339
query74	1839	1231	1136	1136
query75	1226	1156	1007	1007
query76	2300	749	538	538
query77	272	278	213	213
query78	3835	3669	3143	3143
query79	1183	834	565	565
query80	1216	413	367	367
query81	526	198	176	176
query82	711	134	100	100
query83	324	249	236	236
query84	303	122	101	101
query85	851	441	377	377
query86	408	174	176	174
query87	1012	977	907	907
query88	2798	2144	2141	2141
query89	301	231	199	199
query90	1986	144	144	144
query91	155	144	124	124
query92	53	48	42	42
query93	1377	1108	807	807
query94	638	249	221	221
query95	608	380	415	380
query96	827	590	285	285
query97	1077	1053	1005	1005
query98	143	134	136	134
query99	428	343	306	306
Total cold run time: 176548 ms
Total hot run time: 83404 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.58 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 488ebea9f93b8b8ec43875b418875709d46a1b92, data reload: false
query1	0.00	0.00	0.00
query2	0.08	0.04	0.03
query3	0.24	0.11	0.11
query4	1.63	0.10	0.10
query5	0.18	0.16	0.16
query6	1.24	0.67	0.69
query7	0.04	0.01	0.00
query8	0.04	0.03	0.03
query9	0.29	0.21	0.22
query10	0.32	0.34	0.35
query11	0.16	0.11	0.11
query12	0.14	0.12	0.11
query13	0.28	0.30	0.31
query14	0.46	0.44	0.42
query15	0.37	0.38	0.34
query16	0.21	0.25	0.25
query17	0.68	0.73	0.72
query18	0.18	0.16	0.16
query19	1.14	1.22	1.14
query20	0.01	0.01	0.01
query21	15.44	0.16	0.13
query22	5.10	0.04	0.04
query23	16.23	0.27	0.10
query24	7.34	0.30	0.25
query25	0.10	0.04	0.03
query26	0.72	0.16	0.11
query27	0.04	0.02	0.02
query28	3.68	0.52	0.27
query29	12.49	3.12	2.57
query30	0.24	0.12	0.13
query31	2.75	0.37	0.17
query32	3.53	0.32	0.24
query33	1.52	1.47	1.41
query34	15.40	2.16	1.75
query35	1.68	1.73	1.67
query36	0.45	0.29	0.28
query37	0.06	0.04	0.04
query38	0.04	0.03	0.02
query39	0.03	0.02	0.03
query40	0.11	0.07	0.06
query41	0.08	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 94.79 s
Total hot run time: 14.58 s

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 17370 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 2ab8c68ce61c0d7464b3c022314fb425cd4423c2, data reload: false
------ Round 1 ----------------------------------
============================================
q1	17623	3138	3116	3116
q2	2139	249	148	148
q3	10203	936	508	508
q4	4680	252	206	206
q5	7683	573	385	385
q6	161	113	93	93
q7	527	503	390	390
q8	9242	981	931	931
q9	3487	2404	2421	2404
q10	6488	843	713	713
q11	441	257	239	239
q12	703	396	360	360
q13	17859	1537	1151	1151
q14	162	151	141	141
q15	q16	429	399	366	366
q17	800	820	719	719
q18	3207	2292	2248	2248
q19	1239	938	759	759
q20	645	518	473	473
q21	4814	1790	1907	1790
q22	325	266	230	230
Total cold run time: 92857 ms
Total hot run time: 17370 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3467	3427	3437	3427
q2	214	211	161	161
q3	2279	2278	2189	2189
q4	1199	1175	906	906
q5	2182	2137	2093	2093
q6	177	120	84	84
q7	1043	940	838	838
q8	1643	1471	1463	1463
q9	3178	3147	3155	3147
q10	1876	1825	1615	1615
q11	370	278	256	256
q12	451	425	336	336
q13	1479	1553	1160	1160
q14	181	172	164	164
q15	q16	400	393	353	353
q17	1072	1065	1054	1054
q18	5017	4427	4769	4427
q19	859	840	834	834
q20	980	926	840	840
q21	3812	3166	3315	3166
q22	422	352	324	324
Total cold run time: 32301 ms
Total hot run time: 28837 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 83633 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 2ab8c68ce61c0d7464b3c022314fb425cd4423c2, data reload: false
query5	4250	426	342	342
query6	467	166	163	163
query7	4832	433	249	249
query8	322	129	139	129
query9	8685	2946	2934	2934
query10	409	258	224	224
query11	5441	1037	925	925
query12	132	74	73	73
query13	1218	470	326	326
query14	6132	2233	2112	2112
query14_1	2083	1975	1974	1974
query15	187	117	109	109
query16	974	371	358	358
query17	835	446	342	342
query18	2366	309	221	221
query19	187	140	106	106
query20	70	66	68	66
query21	265	117	98	98
query22	5396	5449	5334	5334
query23	6543	6225	6107	6107
query23_1	6153	6027	6121	6027
query24	7380	1118	765	765
query24_1	786	761	745	745
query25	519	280	231	231
query26	1304	265	163	163
query27	2720	460	292	292
query28	4608	1511	1515	1511
query29	1027	465	359	359
query30	304	182	152	152
query31	860	430	351	351
query32	120	52	50	50
query33	560	226	188	188
query34	1117	873	528	528
query35	414	423	350	350
query36	573	559	513	513
query37	131	85	69	69
query38	1064	852	803	803
query39	487	483	484	483
query39_1	435	466	484	466
query40	238	127	112	112
query41	58	57	57	57
query42	82	84	83	83
query43	254	251	215	215
query44	1100	568	561	561
query45	114	107	103	103
query46	774	822	543	543
query47	761	757	729	729
query48	310	337	246	246
query49	541	245	184	184
query50	833	330	263	263
query51	8343	8345	8186	8186
query52	77	77	72	72
query53	216	217	203	203
query54	236	178	181	178
query55	93	58	55	55
query56	225	246	231	231
query57	663	665	671	665
query58	229	168	174	168
query59	1219	1245	1094	1094
query60	260	209	200	200
query61	127	108	112	108
query62	443	223	183	183
query63	193	161	152	152
query64	2835	723	625	625
query65	1619	1640	1515	1515
query66	1797	297	237	237
query67	10061	9743	9579	9579
query68	3064	1134	755	755
query69	375	223	190	190
query70	667	614	626	614
query71	301	259	244	244
query72	2309	1761	1489	1489
query73	726	600	365	365
query74	2008	1202	1119	1119
query75	1245	1157	1007	1007
query76	2373	756	562	562
query77	246	262	201	201
query78	3929	3760	3335	3335
query79	2328	855	586	586
query80	1580	405	350	350
query81	496	204	176	176
query82	716	129	110	110
query83	330	245	228	228
query84	314	123	104	104
query85	929	450	394	394
query86	473	171	169	169
query87	1032	968	891	891
query88	2947	2187	2167	2167
query89	356	229	207	207
query90	2003	153	144	144
query91	159	141	121	121
query92	53	46	44	44
query93	1723	1166	787	787
query94	731	240	239	239
query95	654	440	351	351
query96	824	592	276	276
query97	1050	1042	989	989
query98	170	143	135	135
query99	465	345	304	304
Total cold run time: 181033 ms
Total hot run time: 83633 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.68 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 2ab8c68ce61c0d7464b3c022314fb425cd4423c2, data reload: false
query1	0.00	0.00	0.00
query2	0.08	0.03	0.04
query3	0.26	0.11	0.10
query4	1.60	0.09	0.08
query5	0.18	0.16	0.15
query6	1.24	0.68	0.68
query7	0.03	0.00	0.00
query8	0.04	0.03	0.02
query9	0.29	0.22	0.21
query10	0.34	0.34	0.34
query11	0.16	0.11	0.11
query12	0.15	0.12	0.13
query13	0.30	0.30	0.31
query14	0.46	0.44	0.44
query15	0.36	0.35	0.34
query16	0.22	0.21	0.24
query17	0.74	0.73	0.71
query18	0.17	0.17	0.17
query19	1.13	1.16	1.16
query20	0.01	0.02	0.02
query21	15.52	0.16	0.11
query22	4.94	0.05	0.04
query23	16.19	0.25	0.11
query24	3.45	0.33	0.32
query25	0.16	0.04	0.04
query26	0.77	0.17	0.11
query27	0.04	0.04	0.03
query28	3.59	0.58	0.30
query29	12.41	3.14	2.57
query30	0.25	0.11	0.14
query31	2.76	0.38	0.16
query32	3.49	0.33	0.23
query33	1.35	1.43	1.39
query34	15.38	2.14	1.77
query35	1.76	1.72	1.70
query36	0.50	0.29	0.30
query37	0.06	0.04	0.04
query38	0.05	0.03	0.02
query39	0.03	0.03	0.02
query40	0.14	0.08	0.07
query41	0.07	0.02	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.02
Total cold run time: 90.75 s
Total hot run time: 14.68 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage75.77% (34135/45048)
Line Coverage60.80% (385000/633266)
Region Coverage56.97% (323067/567102)
Branch Coverage57.79% (147281/254845)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage62.18% (28915/46503)
Line Coverage47.24% (302595/640604)
Region Coverage42.92% (244326/569220)
Branch Coverage44.49% (113704/255571)

@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 17287 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b4d155b7094bd76b008f183da7669703c5a1d11b, data reload: false
------ Round 1 ----------------------------------
============================================
q1	17590	3026	3017	3017
q2	1907	248	155	155
q3	10438	872	517	517
q4	4670	242	205	205
q5	7676	590	381	381
q6	137	112	92	92
q7	530	499	384	384
q8	9235	915	951	915
q9	3524	2424	2402	2402
q10	6512	881	695	695
q11	439	255	240	240
q12	695	379	325	325
q13	17863	1532	1139	1139
q14	154	150	139	139
q15	q16	429	399	360	360
q17	822	762	819	762
q18	3146	2325	2237	2237
q19	1112	934	826	826
q20	638	528	502	502
q21	5345	1764	2031	1764
q22	326	262	230	230
Total cold run time: 93188 ms
Total hot run time: 17287 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3399	3338	3329	3329
q2	207	216	155	155
q3	2197	2395	2204	2204
q4	1192	1190	892	892
q5	2200	2140	2105	2105
q6	169	121	85	85
q7	1020	941	841	841
q8	1611	1397	1394	1394
q9	3114	3114	3078	3078
q10	1865	1805	1623	1623
q11	353	277	251	251
q12	462	432	340	340
q13	1500	1571	1195	1195
q14	179	172	172	172
q15	q16	393	393	370	370
q17	1052	1028	1028	1028
q18	4922	4388	4727	4388
q19	848	884	866	866
q20	950	930	798	798
q21	3668	3189	3286	3189
q22	398	355	334	334
Total cold run time: 31699 ms
Total hot run time: 28637 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 83206 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 b4d155b7094bd76b008f183da7669703c5a1d11b, data reload: false
query5	4263	414	347	347
query6	413	165	151	151
query7	4854	443	253	253
query8	289	136	117	117
query9	8667	2848	2890	2848
query10	409	288	213	213
query11	5365	1026	928	928
query12	112	71	69	69
query13	1192	444	337	337
query14	6150	2190	2065	2065
query14_1	1988	1961	1979	1961
query15	174	119	116	116
query16	909	398	323	323
query17	793	451	370	370
query18	2332	331	243	243
query19	176	146	115	115
query20	72	73	72	72
query21	204	117	102	102
query22	5319	5335	5242	5242
query23	6650	6134	5969	5969
query23_1	6233	5993	5923	5923
query24	7323	1088	753	753
query24_1	763	773	769	769
query25	441	307	260	260
query26	1248	272	165	165
query27	2706	438	277	277
query28	4649	1501	1509	1501
query29	947	482	363	363
query30	276	181	149	149
query31	856	421	355	355
query32	102	50	49	49
query33	465	216	189	189
query34	1003	847	489	489
query35	409	405	347	347
query36	570	554	538	538
query37	129	83	74	74
query38	1003	859	814	814
query39	500	494	465	465
query39_1	460	450	471	450
query40	216	126	116	116
query41	58	56	56	56
query42	86	85	81	81
query43	244	240	211	211
query44	1016	553	552	552
query45	113	108	103	103
query46	778	877	529	529
query47	753	733	720	720
query48	334	327	243	243
query49	560	255	183	183
query50	788	333	268	268
query51	7923	8019	8169	8019
query52	75	82	63	63
query53	207	204	161	161
query54	228	179	192	179
query55	84	58	55	55
query56	239	226	303	226
query57	691	654	671	654
query58	233	202	179	179
query59	1176	1221	1084	1084
query60	257	196	193	193
query61	120	131	112	112
query62	361	211	175	175
query63	183	153	153	153
query64	2687	672	586	586
query65	1731	1570	1580	1570
query66	1894	287	243	243
query67	9902	9835	9786	9786
query68	3055	1154	796	796
query69	343	218	197	197
query70	673	612	605	605
query71	298	252	243	243
query72	2264	1730	1605	1605
query73	614	610	364	364
query74	1980	1242	1137	1137
query75	1222	1150	1007	1007
query76	2349	757	565	565
query77	249	257	210	210
query78	3919	3665	3296	3296
query79	2901	851	582	582
query80	1591	383	339	339
query81	514	196	177	177
query82	638	140	106	106
query83	315	252	236	236
query84	300	121	101	101
query85	860	441	378	378
query86	466	163	174	163
query87	1019	976	903	903
query88	3890	2135	2143	2135
query89	306	224	205	205
query90	2205	140	147	140
query91	150	144	120	120
query92	68	48	45	45
query93	3153	1141	810	810
query94	642	241	229	229
query95	616	436	324	324
query96	795	628	285	285
query97	1044	1022	1004	1004
query98	185	145	133	133
query99	417	356	313	313
Total cold run time: 181808 ms
Total hot run time: 83206 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.8 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b4d155b7094bd76b008f183da7669703c5a1d11b, data reload: false
query1	0.00	0.01	0.00
query2	0.08	0.04	0.04
query3	0.25	0.11	0.11
query4	1.60	0.11	0.11
query5	0.17	0.16	0.16
query6	1.25	0.68	0.68
query7	0.03	0.00	0.01
query8	0.04	0.03	0.03
query9	0.28	0.21	0.22
query10	0.34	0.36	0.34
query11	0.16	0.11	0.12
query12	0.15	0.11	0.12
query13	0.30	0.30	0.30
query14	0.46	0.45	0.45
query15	0.36	0.35	0.35
query16	0.22	0.23	0.23
query17	0.70	0.72	0.73
query18	0.16	0.18	0.17
query19	1.08	1.19	1.19
query20	0.01	0.02	0.02
query21	15.43	0.15	0.12
query22	5.07	0.04	0.04
query23	16.18	0.27	0.10
query24	2.99	0.31	0.24
query25	0.10	0.04	0.04
query26	0.76	0.16	0.13
query27	0.03	0.04	0.03
query28	3.64	0.56	0.27
query29	12.43	3.15	2.57
query30	0.25	0.11	0.12
query31	2.76	0.39	0.17
query32	3.50	0.33	0.22
query33	1.39	1.38	1.38
query34	15.32	2.19	1.80
query35	1.73	1.70	1.70
query36	0.47	0.30	0.30
query37	0.06	0.04	0.04
query38	0.04	0.04	0.04
query39	0.03	0.02	0.02
query40	0.12	0.08	0.08
query41	0.07	0.03	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.07 s
Total hot run time: 14.8 s

@eldenmoon
eldenmoonforce-pushed the branch-variant-v2-default-on branch from b4d155b to e9e58c2CompareSeptember 1, 2026 02:05
eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Sep 1, 2026
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant has moved to V2-only execution and storage. The old ColumnVariant V1 implementation kept duplicate factories, cast/load routing, writer/readers, and regression toggles behind enable_variant_v2. This refactor removes the V1 column/data-type/serde implementation, makes Variant factories and storage boundaries produce and accept ColumnVariantV2 only, lets non-V2 compute carriers fail at V2-only boundaries, and updates BE/FE/regression tests to validate V2-only behavior. String-like inputs to Variant are parsed directly into V2 encoded JSON so storage and element access no longer depend on the legacy ColumnVariant carrier.
### Release note
Variant now uses V2 only; the legacy enable_variant_v2 FE config and ColumnVariant V1 implementation are removed.
### Check List (For Author)
- Test: Regression test / Unit Test
- Unit Test: BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=ColumnVariantV2Test.*:VariantPathBuilderTest.*:VariantShredderTest.*:VariantColumnWriterReaderTest.*:HierarchicalDataIteratorTest.*:VariantUtilTest.*:VariantDocModeCompactionTest.*:NestedGroupProviderTest.*:DefaultNestedGroupReadProviderTest.*:VariantRowStoreTest.*:DataTypeVariantV2SerDe*:*VariantV2*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=BinaryColumnExtractIteratorV2Test.*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=CastVariantV2ToTest.*:VariantElementV2EncodedTest.*:VariantElementV2TypedTest.*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF DISABLE_BUILD_UI=ON ./run-fe-ut.sh --run org.apache.doris.nereids.trees.expressions.functions.agg.CountTest,org.apache.doris.nereids.load.VariantLoadParseInjectionTest,org.apache.doris.datasource.scan.PluginDrivenScanNodeCompatibilityTest
- Regression test: ./run-regression-test.sh --run -d variant_p1 passed; ./run-regression-test.sh --run -d variant_p0 passed all runnable suites except regression-test/suites/variant_p0/doc_mode/test_outfile_csv_variant_type.groovy, which failed on external OSS InvalidAccessKeyId 403; affected variant_p0 cases were rerun individually after output regeneration.
- Build: BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF DISABLE_BUILD_UI=ON ./build.sh --be --fe passed; default GLIBC compatibility link failed on duplicate getrandom from the local toolchain, and FE UI build failed with Node 16.3.0 missing node:util.styleText.
- Behavior changed: Yes. Variant no longer supports the legacy V1 ColumnVariant implementation or enable_variant_v2 fallback.
- Does this need documentation: No
@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

// be deleted without changing the V2 representation.
// Transitional field-map representation kept only for Field API callers.
VariantField(VariantMap legacy);
bool is_legacy() const noexcept;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

这个 legacy 是不是可以删了

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 82358 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 fb54daf705c9cd46ad9fe14056f4bc5f085b4ffc, data reload: false
query5	4255	402	338	338
query6	382	142	121	121
query7	4951	416	232	232
query8	290	127	114	114
query9	8695	2882	2900	2882
query10	412	219	183	183
query11	5389	1052	933	933
query12	131	71	70	70
query13	1206	469	325	325
query14	6129	2241	2073	2073
query14_1	1999	1954	1968	1954
query15	173	115	112	112
query16	924	381	355	355
query17	809	468	377	377
query18	2343	334	250	250
query19	175	144	113	113
query20	74	71	71	71
query21	204	102	89	89
query22	5409	5325	5429	5325
query23	6794	6234	5958	5958
query23_1	6210	6233	5996	5996
query24	7289	1098	770	770
query24_1	773	751	791	751
query25	439	314	259	259
query26	1219	231	138	138
query27	2780	439	247	247
query28	4701	1525	1496	1496
query29	946	474	355	355
query30	264	161	128	128
query31	835	401	345	345
query32	162	85	86	85
query33	474	231	194	194
query34	1005	829	483	483
query35	405	405	339	339
query36	567	568	531	531
query37	117	80	70	70
query38	1006	851	835	835
query39	488	474	480	474
query39_1	472	469	474	469
query40	219	94	85	85
query41	63	59	57	57
query42	78	74	80	74
query43	245	252	224	224
query44	1026	546	567	546
query45	112	105	96	96
query46	788	846	523	523
query47	744	752	703	703
query48	309	319	220	220
query49	548	237	197	197
query50	779	263	192	192
query51	8229	8191	8098	8098
query52	74	69	58	58
query53	199	206	142	142
query54	235	200	225	200
query55	84	67	68	67
query56	190	161	157	157
query57	720	678	688	678
query58	219	180	162	162
query59	1208	1238	1137	1137
query60	229	185	192	185
query61	130	153	132	132
query62	387	200	174	174
query63	169	138	153	138
query64	2685	724	620	620
query65	1570	1634	1666	1634
query66	1812	251	240	240
query67	9742	9690	9711	9690
query68	3006	1152	745	745
query69	355	216	207	207
query70	666	602	629	602
query71	249	184	163	163
query72	2536	1800	1576	1576
query73	653	623	321	321
query74	2007	1227	1128	1128
query75	1175	1090	951	951
query76	2363	732	536	536
query77	253	260	210	210
query78	4017	3788	3259	3259
query79	2747	808	580	580
query80	1562	331	283	283
query81	518	156	130	130
query82	1170	139	98	98
query83	281	213	197	197
query84	301	113	92	92
query85	834	359	298	298
query86	485	181	173	173
query87	1024	1006	909	909
query88	2921	2103	2113	2103
query89	285	196	170	170
query90	2031	128	130	128
query91	138	122	102	102
query92	94	66	66	66
query93	2163	1107	712	712
query94	670	257	234	234
query95	537	315	227	227
query96	769	571	254	254
query97	1045	1065	1000	1000
query98	180	137	132	132
query99	438	352	306	306
Total cold run time: 180547 ms
Total hot run time: 82358 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.46 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit fb54daf705c9cd46ad9fe14056f4bc5f085b4ffc, data reload: false
query1	0.00	0.00	0.01
query2	0.07	0.04	0.03
query3	0.25	0.10	0.11
query4	1.60	0.10	0.09
query5	0.17	0.16	0.16
query6	1.28	0.69	0.67
query7	0.03	0.00	0.00
query8	0.05	0.03	0.03
query9	0.30	0.22	0.21
query10	0.34	0.32	0.36
query11	0.16	0.11	0.11
query12	0.15	0.12	0.11
query13	0.31	0.32	0.31
query14	0.45	0.44	0.44
query15	0.35	0.35	0.34
query16	0.22	0.22	0.25
query17	0.68	0.73	0.70
query18	0.18	0.17	0.16
query19	1.15	1.10	1.12
query20	0.02	0.01	0.00
query21	15.48	0.17	0.11
query22	5.07	0.04	0.04
query23	16.16	0.25	0.09
query24	2.92	0.31	0.24
query25	0.10	0.03	0.04
query26	0.77	0.16	0.13
query27	0.04	0.03	0.03
query28	3.63	0.58	0.28
query29	12.43	3.15	2.55
query30	0.25	0.11	0.12
query31	2.77	0.36	0.18
query32	3.54	0.31	0.23
query33	1.35	1.50	1.37
query34	15.37	2.17	1.77
query35	1.73	1.72	1.71
query36	0.45	0.29	0.28
query37	0.07	0.04	0.03
query38	0.05	0.03	0.03
query39	0.03	0.03	0.02
query40	0.11	0.09	0.07
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 90.23 s
Total hot run time: 14.46 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 77.42% (24/31) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage76.09% (34239/45000)
Line Coverage61.04% (385384/631344)
Region Coverage57.47% (325448/566258)
Branch Coverage58.18% (147903/254224)

eldenmoon added a commit to eldenmoon/incubator-doris that referenced this pull request Sep 4, 2026
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant V2 rejected an entire row when a nested array element did not match the target dimension, although non-strict casts should null only the offending element. Nested Variant subpaths rebuilt for constant UNION and one-row relations were also reversed. In addition, several regression cases skipped supported Variant V2 behavior or weakened their assertions. This change uses the existing element cast semantics, preserves root-to-leaf path order, and restores direct coverage for nested arrays, full Variant reads, partial updates, compaction, sparse strings, materialized views, and SQL/JSON null distinctions.
### Release note
Fix Variant V2 nested array cast and nested subpath pruning semantics.
### Check List (For Author)
- Test: Regression test / Unit Test
- VariantPruningLogicTest
- CastVariantV2FromTest
- Focused affected regression suites
- variant_p0 (169/170; one OSS credential failure)
- variant_p1 (4/4)
- Release and ASAN BE builds
- Behavior changed: Yes. Nested array cast mismatches now null the offending element instead of the whole row, and constant nested paths retain root-to-leaf order.
- Does this need documentation: No
@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 17069 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 55e1a385217d8b4760b45029d777a0d07c7866fd, data reload: false
------ Round 1 ----------------------------------
============================================
q1	17631	3013	3002	3002
q2	2081	275	244	244
q3	10208	914	519	519
q4	4674	243	202	202
q5	7689	569	382	382
q6	139	115	95	95
q7	545	500	396	396
q8	9229	973	969	969
q9	3439	2385	2415	2385
q10	6500	857	715	715
q11	387	206	174	174
q12	612	255	192	192
q13	18171	1524	1143	1143
q14	155	150	139	139
q15	q16	443	392	367	367
q17	1450	889	805	805
q18	3070	2236	2232	2232
q19	1253	834	809	809
q20	386	283	202	202
q21	5603	1869	1869	1869
q22	328	265	228	228
Total cold run time: 93993 ms
Total hot run time: 17069 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3367	3255	3287	3255
q2	519	385	382	382
q3	2208	2359	2190	2190
q4	1175	1166	879	879
q5	2220	2103	2101	2101
q6	165	120	87	87
q7	1071	888	875	875
q8	1582	1397	1391	1391
q9	3113	3113	3077	3077
q10	1868	1827	1632	1632
q11	348	268	250	250
q12	447	427	334	334
q13	1468	1540	1158	1158
q14	175	166	176	166
q15	q16	390	400	367	367
q17	3531	3249	3241	3241
q18	4803	4393	4712	4393
q19	863	864	883	864
q20	1030	959	854	854
q21	3828	3133	3232	3133
q22	404	351	316	316
Total cold run time: 34575 ms
Total hot run time: 30945 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 82137 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 55e1a385217d8b4760b45029d777a0d07c7866fd, data reload: false
query5	4241	416	333	333
query6	374	138	123	123
query7	4958	433	234	234
query8	288	122	119	119
query9	8684	2874	2862	2862
query10	389	218	184	184
query11	5398	1029	905	905
query12	129	72	71	71
query13	1192	458	330	330
query14	6107	2187	2063	2063
query14_1	1964	1952	1951	1951
query15	174	123	119	119
query16	909	361	356	356
query17	790	465	360	360
query18	2337	316	242	242
query19	158	138	116	116
query20	76	78	75	75
query21	199	101	87	87
query22	5505	5390	5405	5390
query23	6780	6197	6112	6112
query23_1	6234	6062	6223	6062
query24	7262	1118	760	760
query24_1	792	785	760	760
query25	431	312	266	266
query26	1240	241	134	134
query27	2766	426	269	269
query28	4663	1503	1517	1503
query29	917	413	334	334
query30	241	150	128	128
query31	813	398	324	324
query32	124	73	73	73
query33	453	212	174	174
query34	986	864	479	479
query35	403	385	335	335
query36	601	557	525	525
query37	115	78	68	68
query38	1006	847	802	802
query39	475	478	480	478
query39_1	457	487	464	464
query40	206	87	74	74
query41	54	53	52	52
query42	72	71	71	71
query43	235	238	210	210
query44	1012	552	553	552
query45	108	101	98	98
query46	781	812	537	537
query47	746	761	699	699
query48	308	304	231	231
query49	531	225	181	181
query50	752	267	195	195
query51	8154	8115	7966	7966
query52	71	69	61	61
query53	187	202	144	144
query54	228	180	168	168
query55	70	59	59	59
query56	187	166	192	166
query57	739	657	671	657
query58	196	167	166	166
query59	1237	1216	1097	1097
query60	255	190	179	179
query61	132	126	123	123
query62	351	203	182	182
query63	168	137	146	137
query64	2756	700	655	655
query65	1584	1587	1600	1587
query66	1813	266	209	209
query67	10005	9604	9604	9604
query68	3022	1271	753	753
query69	362	232	199	199
query70	676	634	613	613
query71	259	173	169	169
query72	2407	1771	1538	1538
query73	632	582	332	332
query74	1999	1209	1126	1126
query75	1188	1109	950	950
query76	2387	728	561	561
query77	275	263	211	211
query78	3859	3606	3231	3231
query79	2804	869	561	561
query80	1583	340	284	284
query81	513	157	135	135
query82	631	128	95	95
query83	286	203	188	188
query84	306	116	93	93
query85	833	355	321	321
query86	485	175	175	175
query87	1010	959	910	910
query88	3057	2103	2116	2103
query89	282	194	175	175
query90	2192	124	131	124
query91	132	118	98	98
query92	101	71	74	71
query93	2471	1020	735	735
query94	667	235	217	217
query95	521	318	238	238
query96	852	617	279	279
query97	1047	1075	1014	1014
query98	177	131	141	131
query99	415	351	311	311
Total cold run time: 180414 ms
Total hot run time: 82137 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.65 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 55e1a385217d8b4760b45029d777a0d07c7866fd, data reload: false
query1	0.00	0.00	0.01
query2	0.07	0.04	0.03
query3	0.25	0.11	0.10
query4	1.59	0.10	0.09
query5	0.18	0.16	0.15
query6	1.26	0.70	0.73
query7	0.03	0.00	0.00
query8	0.04	0.03	0.03
query9	0.29	0.21	0.21
query10	0.36	0.34	0.34
query11	0.16	0.12	0.11
query12	0.14	0.12	0.12
query13	0.29	0.31	0.30
query14	0.46	0.45	0.46
query15	0.36	0.36	0.35
query16	0.23	0.21	0.21
query17	0.74	0.68	0.67
query18	0.18	0.15	0.17
query19	1.15	1.09	1.11
query20	0.02	0.01	0.01
query21	15.44	0.16	0.11
query22	5.06	0.04	0.04
query23	16.17	0.26	0.10
query24	3.08	0.30	0.29
query25	0.11	0.03	0.04
query26	0.78	0.16	0.12
query27	0.04	0.03	0.03
query28	3.68	0.52	0.27
query29	12.49	3.17	2.55
query30	0.25	0.12	0.12
query31	2.75	0.36	0.16
query32	3.53	0.31	0.22
query33	1.45	1.48	1.52
query34	15.38	2.18	1.77
query35	1.70	1.75	1.74
query36	0.46	0.29	0.28
query37	0.06	0.04	0.04
query38	0.04	0.04	0.03
query39	0.03	0.02	0.03
query40	0.12	0.08	0.08
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.03	0.02	0.03
Total cold run time: 90.56 s
Total hot run time: 14.65 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 66.67% (2/3) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 74.19% (23/31) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage62.73% (29161/46487)
Line Coverage47.70% (304697/638775)
Region Coverage43.47% (247146/568508)
Branch Coverage44.96% (114640/255009)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 77.42% (24/31) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage76.10% (34249/45008)
Line Coverage61.12% (385928/631416)
Region Coverage57.46% (325411/566282)
Branch Coverage58.28% (148157/254230)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 66.67% (2/3) 🎉
Increment coverage report
Complete coverage report

Issue Number: None
Related PR: apache#66204
Problem Summary: ColumnVariantV2 is implemented in master but remains opt-in through Config.enable_variant_v2, so normal Variant planning and storage continue to select the legacy path. Enable the existing V2 path by default while preserving enable_variant_v2=false as an explicit fallback. Adapt affected regression inputs to use parse_to_variant in V2 mode, keep shared V1/V2 result oracles representation-independent where serialization differs, and retain legacy-only cast coverage without changing production cast behavior.
Enable ColumnVariantV2 by default for Variant execution and storage. The legacy path remains available with enable_variant_v2=false.
- Test:
- Full ASAN BE+FE build without -j
- FE ConfigTest (7/7)
- FE VariantEqualityContextTest (3/3)
- BE focused unit tests (78/78)
- Original affected regression suites (24/24, including two export suites against local MinIO)
- Additional CI regression suites (8/8 with Variant V2 enabled, plus V1 fallback matrix)
- Regression Groovy compilation
- clang-format, check-format, and git diff --check
- Behavior changed: Yes (ColumnVariantV2 is enabled by default; explicit false remains supported)
- Does this need documentation: No
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant has moved to V2-only execution and storage. The old ColumnVariant V1 implementation kept duplicate factories, cast/load routing, writer/readers, and regression toggles behind enable_variant_v2. This refactor removes the V1 column/data-type/serde implementation, makes Variant factories and storage boundaries produce and accept ColumnVariantV2 only, lets non-V2 compute carriers fail at V2-only boundaries, and updates BE/FE/regression tests to validate V2-only behavior. String-like inputs to Variant are parsed directly into V2 encoded JSON so storage and element access no longer depend on the legacy ColumnVariant carrier.
Variant now uses V2 only; the legacy enable_variant_v2 FE config and ColumnVariant V1 implementation are removed.
- Test: Regression test / Unit Test
- Unit Test: BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=ColumnVariantV2Test.*:VariantPathBuilderTest.*:VariantShredderTest.*:VariantColumnWriterReaderTest.*:HierarchicalDataIteratorTest.*:VariantUtilTest.*:VariantDocModeCompactionTest.*:NestedGroupProviderTest.*:DefaultNestedGroupReadProviderTest.*:VariantRowStoreTest.*:DataTypeVariantV2SerDe*:*VariantV2*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=BinaryColumnExtractIteratorV2Test.*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run --filter=CastVariantV2ToTest.*:VariantElementV2EncodedTest.*:VariantElementV2TypedTest.*; BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF DISABLE_BUILD_UI=ON ./run-fe-ut.sh --run org.apache.doris.nereids.trees.expressions.functions.agg.CountTest,org.apache.doris.nereids.load.VariantLoadParseInjectionTest,org.apache.doris.datasource.scan.PluginDrivenScanNodeCompatibilityTest
- Regression test: ./run-regression-test.sh --run -d variant_p1 passed; ./run-regression-test.sh --run -d variant_p0 passed all runnable suites except regression-test/suites/variant_p0/doc_mode/test_outfile_csv_variant_type.groovy, which failed on external OSS InvalidAccessKeyId 403; affected variant_p0 cases were rerun individually after output regeneration.
- Build: BUILD_TYPE=ASAN GLIBC_COMPATIBILITY=OFF DISABLE_BUILD_UI=ON ./build.sh --be --fe passed; default GLIBC compatibility link failed on duplicate getrandom from the local toolchain, and FE UI build failed with Node 16.3.0 missing node:util.styleText.
- Behavior changed: Yes. Variant no longer supports the legacy V1 ColumnVariant implementation or enable_variant_v2 fallback.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Casting STRING, CHAR, or VARCHAR to Variant V2 incorrectly parsed the input as a JSON document. Route string types through the scalar conversion path so the Variant retains its string type and value. Add a focused unit test that distinguishes a JSON-looking string from an object.
### Release note
Casting string values to VARIANT preserves them as strings. Use parse_to_variant for JSON document parsing.
### Check List (For Author)
- Test: Unit Test
- CastVariantV2ToTest: 14 passed
- Behavior changed: Yes, string-to-VARIANT casts no longer parse JSON text.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant element access rejected an empty object key in both FE analysis and BE path resolution, even though the empty string is a valid JSON object key and existing Variant behavior exposes it. Remove those rejections and cover direct, sparse-bucket, rename, and compaction reads.
### Release note
VARIANT object fields with empty-string keys remain addressable.
### Check List (For Author)
- Test: Regression test / Unit Test / Manual test
- BE focused unit tests: 151 passed, 2 skipped, 0 failed
- FE ElementAtTest: 1 passed
- Regression: test_variant_empty_key_sparse_bucket and test_variant_compaction_empty_path_bug passed
- Full ASAN BE and FE build passed
- Behavior changed: Yes, empty-string Variant object keys are accepted and readable
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: The V2-only implementation still carried duplicate V1-era state and branches in TabletColumn, storage readers, VariantField, block transforms, array helpers, and hash joins. Remove those unused switches and no-op paths, reuse the existing V2 representation throughout, and restore the predefine regression input so its other_1 values remain JSON strings before and after compaction.
### Release note
None
### Check List (For Author)
- Test: Regression test / Unit Test
- BE focused unit tests: 151 passed, 2 skipped because NestedGroup write support is unavailable, 0 failed
- Regression: test_all_prdefine_type_to_sparse passed
- Full ASAN BE and FE build passed
- clang-format and build-hygiene checks passed
- Behavior changed: No, this removes obsolete V1-only internal state and no-op work
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant V2 pre-created exact typed paths even when the input path was missing or entirely JSON null, and flat-leaf compaction reconstructed materialized and sparse children only to discard them in the root-only writer. Public Variant aliases also lacked the BIGINT element_at overload after the V2-only migration, while Decimal256 storage read failures were not covered at their real materialized and sparse boundaries. Remove typed-path pre-initialization, keep the converter flow driven by observed non-null leaves, add a root-only mode to the existing hierarchical iterator, restore the integer selector overload, and add focused storage error coverage without exception allowlists.
### Release note
Variant V2 no longer creates physical typed columns for missing or all-JSON-null paths. Flat-leaf compaction reads only the persisted root sidecar, element_at(VARIANT, BIGINT) is supported, and unsupported Decimal256 full-Variant reads return explicit storage-boundary errors.
### Check List (For Author)
- Test: Regression test / Unit Test / Manual test
- ASAN BE build with GLIBC_COMPATIBILITY=OFF
- Variant BE UT: 642 tests, 637 passed and 5 skipped
- variant_p0: 169/169 included suites passed; one OSS credential-dependent suite excluded after confirmed 403
- variant_p1: 4/4 suites passed
- Focused Variant CAST, element_at, Decimal256 storage, RQG, segment golden, and compaction tests passed
- Two array order-by suites remain blocked in FE analysis because multi_distinct_count does not support ARRAY
- Behavior changed: Yes, as described in the release note
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: The main VARIANT compaction regression returned before executing any storage logic, and the current V2 writer cannot produce a real legacy V1 segment for compatibility testing. Add an immutable segment generated by the removed V1 RowsetWriter, read it through the current rowset reader, compact it together with a fresh V2 rowset, and compare every complete VARIANT root after vertical cumulative compaction. Reactivate the storage regressions, remove the deprecated flatten-nested property, and use a currently supported nested-array case.
### Release note
None
### Check List (For Author)
- Test:
- Unit Test: ASAN legacy V1 fixture compaction test and focused VARIANT compaction tests
- Regression test: test_compaction_variant and test_compaction_nokey_variant
- Build: ASAN BE build
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: The V2-only Variant migration made multi_distinct_count reuse COUNT DISTINCT legality checks, which rejected ARRAY inputs. Variant join-key casts could also remain above a cross join and be evaluated once per Cartesian-product row, causing q09_trans to time out. Remove the obsolete legality override and push side-local, non-volatile expressions below cross-join inputs while preserving output identities and volatile-expression evaluation semantics.
### Release note
Restore multi_distinct_count on arrays and avoid repeated Variant join-key casts above cross joins.
### Check List (For Author)
- Test: Regression test / Unit Test
- variant_p0: 169/170 passed; one OSS InvalidAccessKeyId environment failure
- variant_p1: 4/4 passed
- Variant BE ASAN UT: 638 passed, 5 capability skips, 0 failed
- PushDownExpressionsInHashConditionTest: 8/8 passed
- q09_trans, test_array_order_by, test_array_string_order_by passed
- Behavior changed: Yes. Restore array multi_distinct_count and evaluate side-local non-volatile expressions before cross joins without moving volatile expressions.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Empty ColumnVariantV2 destinations encoded typed sources during generic bulk copies. Cross joins therefore converted a materialized Variant child once per Cartesian-product row, making q09_trans spend most of its time in the cross operator. Preserve the homogeneous typed representation for range, repeated, and indexed copies, and convert explicitly only at storage writer boundaries that require encoded rows. Revert the broader FE cross-join expression pushdown because the representation fix addresses the root cause without changing optimizer scope.
### Release note
Preserve typed Variant values across bulk copies to avoid repeated encoding during joins.
### Check List (For Author)
- Test: Regression test / Unit Test
- variant_p0 and variant_p1: 173 suites passed, 0 failed; external OSS credential case excluded
- Variant BE ASAN UT: 620 passed, 5 capability skips, 0 failed
- q09_trans, test_array_order_by, and test_array_string_order_by passed
- PushDownExpressionsInHashConditionTest: 6/6 passed
- Release BE build passed
- Behavior changed: Yes. Empty Variant destinations retain homogeneous typed storage during bulk copies; storage writers still encode explicitly.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: MultiDistinctCount intentionally allows ARRAY arguments, but a stale FE unit test still expected the temporary V2-migration rejection. Restore the test expectation to match the SQL behavior and the legality-check removal.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- CountTest#testMultiDistinctCountAllowsArray
- CountTest
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: N/A
Related PR: apache#66858
Problem Summary: Variant V2 uses a canonical empty-object default, preserves raw string CAST input as a string, and has its own native and Segment storage encoding. Tests and checked-in fixtures that still assumed Variant V1 semantics therefore failed after the V2 migration. Update the expectations and explicit JSON parsing, and regenerate only the affected V2 fixtures after validating the complete Segment golden set.
### Release note
None
### Check List (For Author)
- Test:
- Unit Test
- Regression test
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: apache#66858
Problem Summary: Variant V2 rejected an entire row when a nested array element did not match the target dimension, although non-strict casts should null only the offending element. Nested Variant subpaths rebuilt for constant UNION and one-row relations were also reversed. In addition, several regression cases skipped supported Variant V2 behavior or weakened their assertions. This change uses the existing element cast semantics, preserves root-to-leaf path order, and restores direct coverage for nested arrays, full Variant reads, partial updates, compaction, sparse strings, materialized views, and SQL/JSON null distinctions.
### Release note
Fix Variant V2 nested array cast and nested subpath pruning semantics.
### Check List (For Author)
- Test: Regression test / Unit Test
- VariantPruningLogicTest
- CastVariantV2FromTest
- Focused affected regression suites
- variant_p0 (169/170; one OSS credential failure)
- variant_p1 (4/4)
- Release and ASAN BE builds
- Behavior changed: Yes. Nested array cast mismatches now null the offending element instead of the whole row, and constant nested paths retain root-to-leaf order.
- Does this need documentation: No
@eldenmoon
eldenmoonforce-pushed the branch-variant-v2-default-on branch from 55e1a38 to 8be9b8fCompareSeptember 6, 2026 03:15
@eldenmoon

Copy link
Copy Markdown
MemberAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 16884 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 8be9b8fba74684a8731f4804bfe8dc99875467b9, data reload: false
------ Round 1 ----------------------------------
============================================
q1	17599	3113	3111	3111
q2	2080	271	215	215
q3	10245	881	501	501
q4	4677	247	201	201
q5	7676	562	381	381
q6	135	111	93	93
q7	526	495	384	384
q8	9240	911	884	884
q9	3447	2386	2372	2372
q10	6526	844	698	698
q11	392	195	182	182
q12	620	258	199	199
q13	18117	1554	1179	1179
q14	158	151	145	145
q15	q16	438	390	361	361
q17	1404	844	760	760
q18	3094	2243	2263	2243
q19	1262	902	778	778
q20	371	275	208	208
q21	5641	1761	1885	1761
q22	328	270	228	228
Total cold run time: 93976 ms
Total hot run time: 16884 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3512	3431	3439	3431
q2	501	395	373	373
q3	2251	2407	2202	2202
q4	1198	1164	893	893
q5	2193	2138	2104	2104
q6	170	120	85	85
q7	1049	922	869	869
q8	1594	1429	1419	1419
q9	3139	3111	3121	3111
q10	1855	1830	1644	1644
q11	366	274	259	259
q12	458	431	334	334
q13	1511	1534	1160	1160
q14	166	179	169	169
q15	q16	390	397	359	359
q17	3646	3305	3266	3266
q18	4806	4420	4783	4420
q19	958	854	870	854
q20	1020	984	810	810
q21	3832	3072	3289	3072
q22	405	338	324	324
Total cold run time: 35020 ms
Total hot run time: 31158 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 82062 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 8be9b8fba74684a8731f4804bfe8dc99875467b9, data reload: false
query5	4269	418	346	346
query6	375	135	138	135
query7	4935	423	232	232
query8	290	123	117	117
query9	8683	2913	2862	2862
query10	383	229	179	179
query11	5361	1041	900	900
query12	112	71	71	71
query13	1200	465	317	317
query14	5967	2233	2100	2100
query14_1	1991	1963	1944	1944
query15	171	119	111	111
query16	907	362	343	343
query17	793	453	365	365
query18	2342	331	249	249
query19	168	153	110	110
query20	72	68	69	68
query21	203	104	88	88
query22	5470	5503	5455	5455
query23	7014	6140	6012	6012
query23_1	5966	5984	5994	5984
query24	7301	1105	762	762
query24_1	794	782	776	776
query25	432	309	261	261
query26	1222	237	130	130
query27	2773	410	240	240
query28	4678	1492	1496	1492
query29	945	437	372	372
query30	251	158	131	131
query31	820	404	337	337
query32	134	77	80	77
query33	462	243	184	184
query34	993	823	485	485
query35	407	413	350	350
query36	577	584	534	534
query37	120	81	70	70
query38	1000	850	840	840
query39	505	480	457	457
query39_1	465	479	470	470
query40	205	88	77	77
query41	51	53	50	50
query42	73	75	70	70
query43	240	241	209	209
query44	996	544	559	544
query45	109	103	100	100
query46	773	847	515	515
query47	741	759	699	699
query48	301	304	220	220
query49	539	240	204	204
query50	756	259	200	200
query51	8351	8221	8269	8221
query52	65	65	65	65
query53	190	198	150	150
query54	216	179	259	179
query55	74	62	55	55
query56	199	201	153	153
query57	696	715	654	654
query58	186	160	170	160
query59	1228	1228	1106	1106
query60	240	187	168	168
query61	117	108	132	108
query62	342	201	181	181
query63	177	148	137	137
query64	2684	701	574	574
query65	1657	1578	1583	1578
query66	1906	264	205	205
query67	9919	9430	9625	9430
query68	2758	1164	730	730
query69	338	228	195	195
query70	675	632	614	614
query71	240	184	165	165
query72	2321	1725	1535	1535
query73	670	628	328	328
query74	1566	1226	1126	1126
query75	1176	1103	948	948
query76	2293	735	549	549
query77	265	261	218	218
query78	3810	3611	3231	3231
query79	2920	836	605	605
query80	1579	332	273	273
query81	512	158	143	143
query82	623	128	95	95
query83	282	212	190	190
query84	296	113	91	91
query85	829	410	330	330
query86	472	171	172	171
query87	1003	969	891	891
query88	2900	2114	2114	2114
query89	282	198	180	180
query90	2039	129	129	129
query91	128	120	105	105
query92	93	63	71	63
query93	1783	1063	695	695
query94	615	247	220	220
query95	508	332	226	226
query96	830	641	272	272
query97	1076	1039	1029	1029
query98	171	135	133	133
query99	418	350	307	307
Total cold run time: 178462 ms
Total hot run time: 82062 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.56 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 8be9b8fba74684a8731f4804bfe8dc99875467b9, data reload: false
query1	0.01	0.00	0.01
query2	0.07	0.03	0.04
query3	0.24	0.11	0.11
query4	1.59	0.09	0.10
query5	0.17	0.16	0.16
query6	1.24	0.66	0.68
query7	0.03	0.01	0.01
query8	0.05	0.04	0.03
query9	0.28	0.21	0.22
query10	0.34	0.36	0.35
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.31	0.30	0.30
query14	0.44	0.42	0.44
query15	0.35	0.35	0.35
query16	0.24	0.25	0.23
query17	0.70	0.65	0.76
query18	0.19	0.17	0.18
query19	1.16	1.11	1.10
query20	0.01	0.01	0.01
query21	15.42	0.17	0.11
query22	5.07	0.04	0.05
query23	16.17	0.26	0.10
query24	2.98	0.31	0.25
query25	0.10	0.04	0.02
query26	0.77	0.16	0.12
query27	0.04	0.03	0.03
query28	3.64	0.56	0.30
query29	12.47	3.19	2.56
query30	0.25	0.11	0.13
query31	2.75	0.36	0.17
query32	3.54	0.32	0.23
query33	1.36	1.43	1.53
query34	15.39	2.18	1.74
query35	1.71	1.71	1.70
query36	0.46	0.29	0.29
query37	0.06	0.04	0.04
query38	0.04	0.03	0.03
query39	0.04	0.02	0.02
query40	0.12	0.08	0.08
query41	0.08	0.03	0.03
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.25 s
Total hot run time: 14.56 s

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@eldenmoon@hello-stephen