Skip to content

[fix](variant)fix top-array data into variant column#54396

Merged
eldenmoon merged 11 commits intoapache:masterfrom
amorynan:fix-top-array-for-variant
Aug 14, 2025
Merged

[fix](variant)fix top-array data into variant column#54396
eldenmoon merged 11 commits intoapache:masterfrom
amorynan:fix-top-array-for-variant

Conversation

@amorynan
Copy link
Contributor

@amorynan amorynan commented Aug 6, 2025

What problem does this PR solve?

This pr mainly solves the problem when we insert top-level nested array data into variant columnIssue Number:
like :

mysql> insert into sv1 values (1, '[{"a": 1, "c": 1.1}, {"b": "1"}]');
we maintain the association information between Nested in array , in this case , we will keep same offset at a,b,c ,

mysql> select * from sv1;
+------+----------------------------------------------+
| k    | v                                            |
+------+----------------------------------------------+
|    1 | {"a":[1,null],"b":[null,"1"],"c":[1.1,null]} |
+------+----------------------------------------------+

but in top array we just do flatten array not fill the null value to maintain the association information between Nested in array
like:

mysql> insert into sv1 values (16, '[{"a": 1, "b": 1}, {"b": 2}, {"b": 3}]');
Query OK, 1 row affected (0.15 sec)
{'label':'label_4b3ede8b449a4d9a_b55fdeebe13b741c', 'status':'VISIBLE', 'txnId':'6031'}

mysql> select v from sv1 where k=16;
+-----------------------+
| v                     |
+-----------------------+
| {"a":[1],"b":[1,2,3]} |
+-----------------------+
1 row in set (0.19 sec)

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

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

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

@Thearas
Copy link
Contributor

Thearas commented Aug 6, 2025

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?

@amorynan
Copy link
Contributor Author

amorynan commented Aug 6, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17573	5299	5154	5154
q2	1917	295	190	190
q3	10286	1409	705	705
q4	10225	993	507	507
q5	7514	2369	2240	2240
q6	189	169	133	133
q7	890	766	645	645
q8	9291	1254	1010	1010
q9	6769	5103	5072	5072
q10	6883	2367	1948	1948
q11	461	273	264	264
q12	356	365	241	241
q13	17776	3440	2950	2950
q14	236	231	217	217
q15	527	463	472	463
q16	429	429	370	370
q17	560	815	347	347
q18	7331	7125	7058	7058
q19	1232	983	548	548
q20	326	306	222	222
q21	2759	2958	2364	2364
q22	1021	1055	1004	1004
Total cold run time: 104551 ms
Total hot run time: 33652 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5317	5317	5229	5229
q2	227	313	213	213
q3	2043	2551	2209	2209
q4	1330	1702	1336	1336
q5	4103	4127	4577	4127
q6	231	174	137	137
q7	1992	1913	1841	1841
q8	2557	2469	2379	2379
q9	7423	7311	7409	7311
q10	3226	3323	2945	2945
q11	539	506	481	481
q12	701	763	588	588
q13	3425	3644	3166	3166
q14	285	305	311	305
q15	599	603	483	483
q16	423	505	465	465
q17	1145	1482	1331	1331
q18	9569	7896	7583	7583
q19	12549	887	947	887
q20	2856	2037	1835	1835
q21	15328	4532	4202	4202
q22	1134	1051	1004	1004
Total cold run time: 77002 ms
Total hot run time: 50057 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 170329 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 73f4039d703302e833f912920d00eedcbec136d6, data reload: false

============================================
query1	979	405	406	405
query2	6509	1831	1660	1660
query3	6736	223	221	221
query4	26881	23470	23332	23332
query5	4367	643	509	509
query6	321	239	236	236
query7	4632	530	297	297
query8	310	245	224	224
query9	8589	2972	2975	2972
query10	488	342	306	306
query11	15581	15065	14862	14862
query12	189	133	128	128
query13	1673	545	421	421
query14	8599	5837	5909	5837
query15	209	193	167	167
query16	7145	695	489	489
query17	999	764	647	647
query18	2001	445	325	325
query19	223	211	188	188
query20	153	148	142	142
query21	217	131	110	110
query22	3907	4013	3750	3750
query23	34904	34459	34409	34409
query24	7962	2405	2414	2405
query25	579	530	441	441
query26	1225	291	162	162
query27	2696	501	339	339
query28	4358	2345	2333	2333
query29	841	624	486	486
query30	304	241	206	206
query31	914	799	700	700
query32	89	75	80	75
query33	558	432	384	384
query34	814	854	529	529
query35	828	809	745	745
query36	1056	1042	937	937
query37	131	113	95	95
query38	3930	3986	3941	3941
query39	1454	1393	1376	1376
query40	241	148	136	136
query41	61	59	54	54
query42	143	124	126	124
query43	525	533	487	487
query44	1406	875	877	875
query45	203	187	182	182
query46	949	1076	670	670
query47	1801	1835	1736	1736
query48	406	422	320	320
query49	705	502	404	404
query50	661	701	412	412
query51	4271	4194	4153	4153
query52	126	137	125	125
query53	253	285	214	214
query54	640	630	554	554
query55	94	88	89	88
query56	377	354	342	342
query57	1224	1208	1148	1148
query58	333	338	328	328
query59	2705	2689	2537	2537
query60	418	430	401	401
query61	126	141	121	121
query62	814	737	677	677
query63	251	216	218	216
query64	4423	1127	812	812
query65	4188	4112	4131	4112
query66	1152	458	321	321
query67	query68	17134	866	859	859
query69	1195	300	285	285
query70	1484	1194	1137	1137
query71	670	323	323	323
query72	9149	2294	2179	2179
query73	3534	692	354	354
query74	9002	8932	8574	8574
query75	7364	3118	2654	2654
query76	8643	1238	804	804
query77	1162	430	330	330
query78	9589	10690	9424	9424
query79	15195	584	576	576
query80	1066	556	471	471
query81	559	282	221	221
query82	455	155	186	155
query83	295	283	277	277
query84	292	99	81	81
query85	899	393	355	355
query86	356	327	288	288
query87	4198	4130	4092	4092
query88	5610	2263	2170	2170
query89	479	373	323	323
query90	2614	226	225	225
query91	140	137	111	111
query92	86	76	66	66
query93	6175	1012	663	663
query94	1103	402	276	276
query95	424	324	320	320
query96	512	578	281	281
query97	2712	2703	2602	2602
query98	244	237	222	222
query99	1461	1436	1291	1291
Total cold run time: 305648 ms
Total hot run time: 170329 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 33.38 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 73f4039d703302e833f912920d00eedcbec136d6, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.08	0.07
query4	1.63	0.11	0.11
query5	0.40	0.42	0.42
query6	1.19	0.65	0.64
query7	0.03	0.02	0.02
query8	0.05	0.03	0.03
query9	0.56	0.47	0.47
query10	0.51	0.53	0.54
query11	0.15	0.10	0.11
query12	0.14	0.11	0.11
query13	0.67	0.64	0.66
query14	0.91	1.22	0.96
query15	0.97	0.90	0.88
query16	0.40	0.40	0.39
query17	1.11	1.04	1.07
query18	0.22	0.20	0.20
query19	2.01	1.86	1.81
query20	0.01	0.02	0.01
query21	15.36	0.88	0.55
query22	0.82	1.28	0.74
query23	14.76	1.11	0.66
query24	6.66	1.08	1.49
query25	0.56	0.12	0.10
query26	0.55	0.15	0.12
query27	0.06	0.06	0.05
query28	10.28	0.85	0.44
query29	12.62	3.81	3.32
query30	3.02	3.04	2.97
query31	2.81	0.57	0.40
query32	3.23	0.57	0.50
query33	3.03	3.22	3.15
query34	16.11	5.37	4.95
query35	4.92	4.97	4.96
query36	0.71	0.52	0.51
query37	0.10	0.07	0.07
query38	0.06	0.05	0.04
query39	0.03	0.03	0.03
query40	0.16	0.14	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 107.32 s
Total hot run time: 33.38 s

@amorynan
Copy link
Contributor Author

amorynan commented Aug 6, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17593	5297	5296	5296
q2	1935	280	183	183
q3	10291	1361	711	711
q4	10209	1006	530	530
q5	7533	2314	2298	2298
q6	183	167	130	130
q7	945	757	617	617
q8	9293	1277	946	946
q9	6814	5027	5058	5027
q10	6894	2370	1997	1997
q11	463	283	257	257
q12	346	363	234	234
q13	17775	3474	3012	3012
q14	227	240	228	228
q15	534	468	453	453
q16	421	411	367	367
q17	555	815	352	352
q18	7626	7056	6858	6858
q19	1225	967	553	553
q20	325	317	216	216
q21	3364	2421	2225	2225
q22	1000	1051	951	951
Total cold run time: 105551 ms
Total hot run time: 33441 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5350	5333	5323	5323
q2	229	305	211	211
q3	2086	2576	2182	2182
q4	1330	1715	1297	1297
q5	4115	4179	4426	4179
q6	226	175	136	136
q7	2018	1874	1796	1796
q8	2448	2527	2509	2509
q9	7366	7289	7320	7289
q10	3208	3471	2941	2941
q11	555	494	506	494
q12	709	810	618	618
q13	3421	3761	3309	3309
q14	311	328	285	285
q15	523	470	449	449
q16	592	550	594	550
q17	1326	1483	1345	1345
q18	12399	7718	7629	7629
q19	13426	906	923	906
q20	3812	2024	1932	1932
q21	14935	4303	4292	4292
q22	1096	1003	1015	1003
Total cold run time: 81481 ms
Total hot run time: 50675 ms

@doris-robot
Copy link

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

============================================
query1	1017	383	409	383
query2	6502	1877	1649	1649
query3	6742	224	218	218
query4	27155	23453	23483	23453
query5	4402	666	524	524
query6	334	255	227	227
query7	4652	526	308	308
query8	286	256	236	236
query9	8610	2959	2955	2955
query10	475	349	295	295
query11	16140	15355	14709	14709
query12	188	139	135	135
query13	1671	547	413	413
query14	8535	5902	5748	5748
query15	205	195	169	169
query16	7123	669	456	456
query17	967	752	621	621
query18	2010	434	304	304
query19	219	215	180	180
query20	147	144	137	137
query21	219	127	113	113
query22	3941	3976	4003	3976
query23	34960	34548	34456	34456
query24	8129	2424	2462	2424
query25	589	516	449	449
query26	1240	297	173	173
query27	2708	516	361	361
query28	4448	2344	2346	2344
query29	861	652	534	534
query30	306	238	208	208
query31	931	811	721	721
query32	94	83	92	83
query33	620	497	364	364
query34	847	863	530	530
query35	839	826	750	750
query36	1021	1055	930	930
query37	147	114	92	92
query38	3975	3974	3982	3974
query39	1446	1370	1367	1367
query40	243	146	137	137
query41	61	59	54	54
query42	145	130	170	130
query43	526	516	489	489
query44	1483	883	877	877
query45	206	185	183	183
query46	986	1116	692	692
query47	1810	1813	1744	1744
query48	425	449	329	329
query49	719	532	455	455
query50	703	750	430	430
query51	4186	4157	4107	4107
query52	131	140	118	118
query53	280	303	213	213
query54	683	660	566	566
query55	93	91	90	90
query56	371	358	357	357
query57	1193	1203	1138	1138
query58	348	354	342	342
query59	2661	2635	2550	2550
query60	416	402	397	397
query61	129	156	146	146
query62	814	768	650	650
query63	263	226	212	212
query64	4405	1111	784	784
query65	4265	4184	4157	4157
query66	1141	452	335	335
query67	query68	17413	868	822	822
query69	1134	282	296	282
query70	1603	1059	1113	1059
query71	704	315	316	315
query72	9269	2294	2131	2131
query73	3332	711	356	356
query74	9045	8928	8850	8850
query75	7608	3082	2646	2646
query76	8845	1224	792	792
query77	1150	418	335	335
query78	9541	10028	9175	9175
query79	14549	608	570	570
query80	1542	565	496	496
query81	563	262	227	227
query82	432	158	121	121
query83	346	289	312	289
query84	307	97	82	82
query85	926	402	331	331
query86	343	320	295	295
query87	4232	4201	4123	4123
query88	5625	2231	2244	2231
query89	479	375	318	318
query90	2580	235	243	235
query91	150	141	115	115
query92	86	72	68	68
query93	6047	1022	651	651
query94	913	418	281	281
query95	397	336	324	324
query96	513	593	285	285
query97	2663	2716	2567	2567
query98	267	243	226	226
query99	1467	1423	1295	1295
Total cold run time: 307458 ms
Total hot run time: 170544 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 33.32 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 3e336fcb9787a86af1d99dfa1fbe5479feec9856, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.05	0.04
query3	0.24	0.07	0.08
query4	1.61	0.10	0.10
query5	0.40	0.40	0.42
query6	1.18	0.65	0.64
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.55	0.48	0.47
query10	0.52	0.52	0.53
query11	0.16	0.10	0.11
query12	0.14	0.11	0.11
query13	0.65	0.64	0.65
query14	0.94	1.14	1.19
query15	0.89	0.88	0.87
query16	0.38	0.40	0.40
query17	1.07	1.03	1.05
query18	0.21	0.20	0.20
query19	1.94	1.81	1.83
query20	0.01	0.01	0.01
query21	15.37	0.83	0.57
query22	0.78	1.27	0.96
query23	14.70	1.13	0.67
query24	6.94	1.36	0.66
query25	0.55	0.17	0.10
query26	0.59	0.15	0.13
query27	0.06	0.06	0.05
query28	9.49	0.86	0.44
query29	12.55	3.90	3.34
query30	3.16	2.94	2.97
query31	2.81	0.57	0.39
query32	3.23	0.57	0.50
query33	2.99	3.20	3.19
query34	15.99	5.41	4.88
query35	4.89	4.98	5.00
query36	0.69	0.52	0.51
query37	0.11	0.08	0.08
query38	0.06	0.05	0.05
query39	0.03	0.03	0.02
query40	0.18	0.13	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.04
Total cold run time: 106.43 s
Total hot run time: 33.32 s

@amorynan
Copy link
Contributor Author

amorynan commented Aug 7, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17592	5410	5113	5113
q2	1935	297	201	201
q3	10305	1522	706	706
q4	10230	1039	513	513
q5	7466	2365	2304	2304
q6	178	172	134	134
q7	934	769	634	634
q8	9329	1266	1034	1034
q9	6933	5121	5125	5121
q10	6934	2344	1967	1967
q11	467	291	269	269
q12	357	367	237	237
q13	17764	3514	2945	2945
q14	236	239	218	218
q15	565	473	479	473
q16	422	423	390	390
q17	565	820	359	359
q18	7238	6955	6918	6918
q19	2732	980	562	562
q20	328	310	220	220
q21	3336	3045	2319	2319
q22	1062	1042	974	974
Total cold run time: 106908 ms
Total hot run time: 33611 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5446	5260	5287	5260
q2	235	313	215	215
q3	2088	2585	2216	2216
q4	1341	1702	1333	1333
q5	4117	4416	4443	4416
q6	223	175	138	138
q7	2012	1971	1759	1759
q8	2476	2459	2460	2459
q9	7411	7459	7335	7335
q10	4094	3336	2959	2959
q11	555	508	486	486
q12	761	821	692	692
q13	3400	3728	3221	3221
q14	292	319	298	298
q15	511	451	455	451
q16	431	495	487	487
q17	1198	1500	1394	1394
q18	8122	7640	7956	7640
q19	12538	934	983	934
q20	4832	1954	1798	1798
q21	13852	4286	4328	4286
q22	1143	1040	989	989
Total cold run time: 77078 ms
Total hot run time: 50766 ms

@doris-robot
Copy link

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

============================================
query1	1014	417	420	417
query2	6512	1773	1699	1699
query3	6753	224	221	221
query4	27082	23673	23544	23544
query5	4382	626	532	532
query6	341	258	232	232
query7	4653	517	293	293
query8	283	243	228	228
query9	8572	2966	2944	2944
query10	495	346	301	301
query11	15406	14914	15016	14914
query12	182	140	134	134
query13	1659	573	419	419
query14	8646	5824	5908	5824
query15	229	192	165	165
query16	7126	707	467	467
query17	983	790	654	654
query18	2026	431	313	313
query19	219	203	181	181
query20	149	143	136	136
query21	221	132	111	111
query22	4034	3939	3864	3864
query23	34450	34294	34397	34294
query24	6726	2375	2441	2375
query25	505	519	452	452
query26	722	295	159	159
query27	2369	513	346	346
query28	3087	2353	2316	2316
query29	656	601	489	489
query30	289	243	203	203
query31	889	793	728	728
query32	86	82	85	82
query33	544	417	399	399
query34	799	850	526	526
query35	819	848	790	790
query36	1037	1056	960	960
query37	133	110	96	96
query38	3913	3960	3926	3926
query39	1448	1356	1385	1356
query40	239	141	130	130
query41	63	58	56	56
query42	142	131	127	127
query43	516	530	469	469
query44	1397	886	866	866
query45	200	193	183	183
query46	939	1068	676	676
query47	1812	1806	1759	1759
query48	396	434	325	325
query49	680	511	422	422
query50	659	681	410	410
query51	4182	4289	4177	4177
query52	125	128	117	117
query53	265	280	211	211
query54	649	644	553	553
query55	90	89	88	88
query56	351	366	348	348
query57	1188	1213	1148	1148
query58	335	335	333	333
query59	2640	2662	2530	2530
query60	399	393	378	378
query61	125	127	163	127
query62	747	764	655	655
query63	252	229	213	213
query64	2357	1129	794	794
query65	4202	4150	4149	4149
query66	1039	453	347	347
query67	query68	17590	1018	1129	1018
query69	1006	279	286	279
query70	1367	1107	1069	1069
query71	712	349	315	315
query72	9175	2306	2437	2306
query73	3391	636	356	356
query74	9065	8986	8774	8774
query75	7556	3143	2684	2684
query76	8701	1212	867	867
query77	1144	413	334	334
query78	9596	11351	9312	9312
query79	15140	599	604	599
query80	2681	554	499	499
query81	537	261	228	228
query82	531	152	118	118
query83	392	292	269	269
query84	291	109	87	87
query85	869	381	338	338
query86	371	310	309	309
query87	4271	4164	4183	4164
query88	5430	2197	2216	2197
query89	477	367	319	319
query90	2404	240	223	223
query91	147	144	114	114
query92	84	72	66	66
query93	6281	969	656	656
query94	1171	392	290	290
query95	425	326	313	313
query96	505	597	283	283
query97	2777	2731	2654	2654
query98	253	235	224	224
query99	1486	1440	1282	1282
Total cold run time: 301254 ms
Total hot run time: 171227 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.07	0.04	0.04
query3	0.24	0.07	0.07
query4	1.62	0.11	0.10
query5	0.40	0.44	0.44
query6	1.21	0.66	0.66
query7	0.02	0.02	0.02
query8	0.05	0.03	0.04
query9	0.56	0.47	0.46
query10	0.53	0.53	0.53
query11	0.16	0.10	0.10
query12	0.15	0.12	0.12
query13	0.64	0.63	0.67
query14	0.94	1.20	1.04
query15	0.92	0.90	0.88
query16	0.38	0.39	0.38
query17	1.05	1.10	1.07
query18	0.22	0.20	0.20
query19	1.95	1.89	1.90
query20	0.02	0.01	0.01
query21	15.38	0.85	0.54
query22	0.75	1.17	0.63
query23	15.02	1.11	0.64
query24	6.83	1.74	0.30
query25	0.28	0.23	0.09
query26	0.63	0.16	0.12
query27	0.06	0.06	0.05
query28	9.49	0.89	0.45
query29	12.62	3.82	3.33
query30	3.07	3.01	2.98
query31	2.82	0.58	0.40
query32	3.23	0.56	0.49
query33	3.04	3.13	3.19
query34	16.22	5.29	4.94
query35	4.91	4.95	5.02
query36	0.68	0.52	0.49
query37	0.10	0.08	0.07
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.16	0.14	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.04
Total cold run time: 106.72 s
Total hot run time: 32.6 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 36.47% (31/85) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.31% (16387/28102)
Line Coverage 47.20% (148134/313828)
Region Coverage 36.17% (110854/306506)
Branch Coverage 39.08% (49270/126070)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 52.94% (45/85) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.32% (22427/27579)
Line Coverage 74.03% (232270/313766)
Region Coverage 61.50% (193550/314709)
Branch Coverage 65.47% (83539/127598)

@amorynan
Copy link
Contributor Author

amorynan commented Aug 8, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17609	5225	5157	5157
q2	1938	291	189	189
q3	10308	1389	707	707
q4	10207	996	492	492
q5	7527	2373	2386	2373
q6	181	171	130	130
q7	904	758	643	643
q8	9286	1250	1009	1009
q9	6685	5018	5058	5018
q10	6877	2377	1975	1975
q11	462	272	260	260
q12	345	362	226	226
q13	17808	3541	2984	2984
q14	241	248	223	223
q15	526	479	454	454
q16	413	416	373	373
q17	554	792	378	378
q18	7196	7029	7042	7029
q19	1771	981	544	544
q20	312	302	203	203
q21	3352	2398	2323	2323
q22	1067	1033	991	991
Total cold run time: 105569 ms
Total hot run time: 33681 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5358	5308	5257	5257
q2	242	312	217	217
q3	2057	2613	2153	2153
q4	1309	1683	1288	1288
q5	4201	4227	4241	4227
q6	216	177	144	144
q7	1952	1927	1768	1768
q8	2513	2443	2422	2422
q9	7243	7353	7201	7201
q10	3146	3421	2942	2942
q11	544	554	504	504
q12	750	822	666	666
q13	3432	3864	3156	3156
q14	277	297	275	275
q15	502	450	446	446
q16	451	556	459	459
q17	1235	1827	1325	1325
q18	8910	7638	7678	7638
q19	12207	1035	1096	1035
q20	2034	2029	1863	1863
q21	15374	4199	4172	4172
q22	1059	1040	960	960
Total cold run time: 75012 ms
Total hot run time: 50118 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 169334 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 957615f31380ea5e9ca38078a70564fa543e1ec4, data reload: false

============================================
query1	987	371	411	371
query2	6533	1776	1751	1751
query3	6740	227	223	223
query4	26829	23225	22743	22743
query5	4380	638	514	514
query6	325	249	218	218
query7	4629	511	299	299
query8	290	240	232	232
query9	8665	2952	2910	2910
query10	485	358	295	295
query11	15825	15315	15078	15078
query12	179	142	147	142
query13	1669	570	413	413
query14	9869	5945	5881	5881
query15	214	190	168	168
query16	7135	656	450	450
query17	1232	745	610	610
query18	2070	452	313	313
query19	215	204	194	194
query20	150	144	161	144
query21	221	126	115	115
query22	4094	3984	3855	3855
query23	34540	34378	34483	34378
query24	6452	2363	2419	2363
query25	503	501	444	444
query26	723	291	160	160
query27	1931	476	348	348
query28	2853	2327	2317	2317
query29	663	591	483	483
query30	299	242	196	196
query31	863	798	700	700
query32	86	108	79	79
query33	540	414	351	351
query34	805	832	515	515
query35	808	825	782	782
query36	1014	1033	904	904
query37	133	110	92	92
query38	3959	3914	3902	3902
query39	1443	1387	1394	1387
query40	266	140	133	133
query41	64	60	54	54
query42	138	120	122	120
query43	507	522	468	468
query44	1372	863	856	856
query45	204	186	184	184
query46	951	1064	675	675
query47	1814	1882	1737	1737
query48	393	433	323	323
query49	672	499	416	416
query50	652	685	402	402
query51	4222	4242	4179	4179
query52	130	136	119	119
query53	261	286	210	210
query54	649	659	574	574
query55	93	92	91	91
query56	358	348	358	348
query57	1192	1226	1119	1119
query58	341	332	329	329
query59	2620	2654	2494	2494
query60	411	388	392	388
query61	127	145	123	123
query62	830	749	672	672
query63	262	211	214	211
query64	2368	1092	782	782
query65	4211	4102	4111	4102
query66	1016	441	336	336
query67	query68	18579	1115	674	674
query69	1030	303	278	278
query70	1434	1113	1137	1113
query71	710	341	320	320
query72	9165	2337	2377	2337
query73	3579	618	350	350
query74	9065	8954	8517	8517
query75	7616	3135	2670	2670
query76	8878	1208	786	786
query77	1145	417	327	327
query78	9338	9653	9063	9063
query79	12624	702	584	584
query80	998	554	502	502
query81	545	262	227	227
query82	303	158	118	118
query83	364	303	284	284
query84	304	95	80	80
query85	810	377	350	350
query86	354	331	298	298
query87	4196	4168	4051	4051
query88	2969	2218	2269	2218
query89	473	370	321	321
query90	2541	238	234	234
query91	149	141	114	114
query92	123	73	69	69
query93	4269	977	652	652
query94	956	399	283	283
query95	402	343	326	326
query96	509	612	289	289
query97	2677	2700	2608	2608
query98	247	234	237	234
query99	1456	1416	1292	1292
Total cold run time: 294283 ms
Total hot run time: 169334 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 33.8 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 957615f31380ea5e9ca38078a70564fa543e1ec4, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.05	0.04
query3	0.24	0.08	0.08
query4	1.60	0.10	0.10
query5	0.41	0.43	0.45
query6	1.14	0.68	0.67
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.55	0.48	0.46
query10	0.52	0.53	0.53
query11	0.16	0.11	0.11
query12	0.14	0.11	0.11
query13	0.67	0.65	0.64
query14	0.90	1.12	1.13
query15	0.91	0.87	0.89
query16	0.38	0.38	0.38
query17	1.09	1.06	1.12
query18	0.22	0.21	0.21
query19	2.01	1.80	1.94
query20	0.02	0.02	0.02
query21	15.44	0.88	0.55
query22	0.78	1.26	0.86
query23	14.72	1.19	0.65
query24	6.66	1.64	0.94
query25	0.47	0.13	0.24
query26	0.57	0.15	0.13
query27	0.08	0.05	0.05
query28	10.04	0.87	0.46
query29	12.78	3.89	3.39
query30	3.07	2.97	2.97
query31	2.82	0.57	0.40
query32	3.24	0.57	0.51
query33	3.04	3.27	3.22
query34	16.18	5.42	4.98
query35	4.90	4.97	4.99
query36	0.69	0.52	0.51
query37	0.10	0.07	0.08
query38	0.06	0.05	0.05
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.08	0.04	0.02
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 107.18 s
Total hot run time: 33.8 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 36.47% (31/85) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.89% (16586/28166)
Line Coverage 47.78% (150290/314522)
Region Coverage 36.68% (112643/307074)
Branch Coverage 39.64% (50042/126251)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 52.94% (45/85) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.44% (22513/27642)
Line Coverage 74.13% (233174/314531)
Region Coverage 61.65% (194398/315325)
Branch Coverage 65.61% (83848/127799)

@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17599	5327	5297	5297
q2	1922	306	189	189
q3	10287	1385	724	724
q4	10227	1012	511	511
q5	7537	2392	2300	2300
q6	177	165	142	142
q7	906	774	617	617
q8	9308	1292	1078	1078
q9	6894	5138	5096	5096
q10	6915	2393	2043	2043
q11	467	282	277	277
q12	355	370	224	224
q13	17789	3505	3009	3009
q14	240	243	228	228
q15	532	476	467	467
q16	433	421	384	384
q17	587	840	353	353
q18	7368	7165	6946	6946
q19	1722	972	553	553
q20	319	342	224	224
q21	3563	3197	2332	2332
q22	1070	1057	995	995
Total cold run time: 106217 ms
Total hot run time: 33989 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5419	5371	5319	5319
q2	244	318	223	223
q3	2085	2589	2214	2214
q4	1325	1750	1354	1354
q5	4163	4508	4466	4466
q6	227	183	136	136
q7	2008	1936	1807	1807
q8	2651	2519	2529	2519
q9	7207	7199	7408	7199
q10	3195	3381	2951	2951
q11	565	498	491	491
q12	756	853	650	650
q13	3411	3766	3403	3403
q14	302	385	319	319
q15	518	459	459	459
q16	480	504	445	445
q17	1209	1471	1379	1379
q18	7942	7866	7433	7433
q19	12346	1009	1141	1009
q20	2749	2098	1916	1916
q21	15357	4232	4264	4232
q22	1035	1050	983	983
Total cold run time: 75194 ms
Total hot run time: 50907 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 161506 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 622b8cfa15547e3ca2e8b58ce06bfa5f46ffe6a2, data reload: false

reason	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
============================================
query1	1003	381	421	381
query2	6542	1804	1755	1755
query3	6747	230	220	220
query4	26579	23788	23374	23374
query5	4350	650	518	518
query6	320	230	222	222
query7	4638	517	301	301
query8	279	238	211	211
query9	8542	2960	2956	2956
query10	495	359	288	288
query11	15875	15031	14992	14992
query12	177	132	129	129
query13	1662	560	396	396
query14	8533	5777	5783	5777
query15	208	195	167	167
query16	7128	629	443	443
query17	944	743	682	682
query18	1989	426	319	319
query19	214	211	177	177
query20	146	154	136	136
query21	222	125	109	109
query22	4133	4242	4003	4003
query23	34901	34242	34635	34242
query24	8258	2360	2454	2360
query25	581	531	431	431
query26	1249	290	192	192
query27	2689	501	358	358
query28	4381	2311	2331	2311
query29	803	605	486	486
query30	295	254	197	197
query31	899	782	715	715
query32	87	79	78	78
query33	623	414	395	395
query34	815	897	520	520
query35	786	825	766	766
query36	1023	1042	938	938
query37	134	112	95	95
query38	3990	3989	3913	3913
query39	1462	1377	1362	1362
query40	241	149	139	139
query41	69	64	61	61
query42	141	130	127	127
query43	535	526	499	499
query44	1409	878	879	878
query45	203	189	180	180
query46	972	1074	673	673
query47	1828	1846	1789	1789
query48	411	460	324	324
query49	757	498	431	431
query50	669	717	424	424
query51	4251	4170	4155	4155
query52	133	138	118	118
query53	264	290	237	237
query54	662	682	560	560
query55	91	94	86	86
query56	357	366	372	366
query57	1213	1260	1153	1153
query58	342	356	333	333
query59	2598	2609	2596	2596
query60	402	388	387	387
query61	126	120	120	120
query62	816	740	653	653
query63	250	209	217	209
query64	4362	1146	776	776
query65	4210	4110	4153	4110
query66	1160	455	337	337
query67	query68	19040	1094	762	762
query69	988	297	288	288
query70	1424	1063	1150	1063
query71	643	334	320	320
query72	9049	2315	4808	2315
query73	4581	774	353	353
query74	8957	8895	8860	8860
query75	6930	3169	2630	2630
query76	8351	1220	798	798
query77	1153	417	335	335
query78	query79	17599	598	566	566
query80	2353	593	487	487
query81	547	268	224	224
query82	388	153	116	116
query83	372	283	273	273
query84	308	97	88	88
query85	1624	402	355	355
query86	370	323	302	302
query87	4157	4254	4031	4031
query88	4901	2268	2292	2268
query89	525	374	314	314
query90	2591	240	235	235
query91	150	139	125	125
query92	93	73	65	65
query93	6575	988	648	648
query94	1136	396	281	281
query95	407	327	316	316
query96	507	602	287	287
query97	2673	2737	2625	2625
query98	269	235	303	235
query99	1543	1330	1305	1305
Total cold run time: 302378 ms
Total hot run time: 161506 ms

@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17606	5298	5144	5144
q2	1924	274	183	183
q3	10321	1278	755	755
q4	10208	1023	537	537
q5	7506	2350	2411	2350
q6	182	165	131	131
q7	890	762	645	645
q8	9313	1381	1185	1185
q9	6960	5064	5260	5064
q10	6936	2396	1991	1991
q11	497	293	268	268
q12	356	359	231	231
q13	17760	3687	3028	3028
q14	233	238	213	213
q15	538	483	500	483
q16	461	437	382	382
q17	603	867	366	366
q18	7990	7142	7141	7141
q19	1102	982	580	580
q20	352	345	221	221
q21	3999	3345	2506	2506
q22	1060	1044	982	982
Total cold run time: 106797 ms
Total hot run time: 34386 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5297	5190	5157	5157
q2	248	325	218	218
q3	2194	2696	2318	2318
q4	1407	1838	1370	1370
q5	4466	4632	4539	4539
q6	223	177	130	130
q7	2081	2022	1839	1839
q8	2719	2601	2895	2601
q9	7170	7266	7220	7220
q10	3104	3310	2854	2854
q11	591	513	508	508
q12	674	768	664	664
q13	3568	3954	3396	3396
q14	295	334	300	300
q15	520	486	484	484
q16	489	498	435	435
q17	1222	1695	1402	1402
q18	8072	7776	7639	7639
q19	852	895	1150	895
q20	2028	2043	1915	1915
q21	5018	4600	4229	4229
q22	1104	1027	1002	1002
Total cold run time: 53342 ms
Total hot run time: 51115 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185049 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 0cdad77601a077fb50dcc202bb080e76dd453e16, data reload: false

query1	1020	414	406	406
query2	6505	1763	1761	1761
query3	6737	220	221	220
query4	26648	23587	23262	23262
query5	4333	641	484	484
query6	325	227	211	211
query7	4623	505	293	293
query8	272	239	226	226
query9	8624	2901	2889	2889
query10	498	330	290	290
query11	15490	14985	14726	14726
query12	167	115	123	115
query13	1656	545	430	430
query14	8665	5875	5743	5743
query15	203	183	167	167
query16	7572	672	472	472
query17	1218	723	602	602
query18	2015	437	323	323
query19	208	192	176	176
query20	131	121	118	118
query21	212	122	111	111
query22	4256	4148	4029	4029
query23	34301	33408	33299	33299
query24	8110	2396	2390	2390
query25	529	471	409	409
query26	1225	268	160	160
query27	2728	504	344	344
query28	4327	2284	2266	2266
query29	740	552	452	452
query30	283	229	196	196
query31	888	800	728	728
query32	87	70	81	70
query33	561	379	343	343
query34	802	840	525	525
query35	802	828	740	740
query36	990	996	917	917
query37	118	102	83	83
query38	4129	3998	3924	3924
query39	1460	1451	1403	1403
query40	219	127	116	116
query41	59	56	58	56
query42	125	110	117	110
query43	500	513	467	467
query44	1318	848	850	848
query45	176	171	163	163
query46	859	1013	651	651
query47	1776	1806	1736	1736
query48	392	448	331	331
query49	725	476	411	411
query50	634	698	402	402
query51	4137	4188	4136	4136
query52	116	108	103	103
query53	232	267	204	204
query54	581	595	517	517
query55	86	87	91	87
query56	324	316	307	307
query57	1201	1179	1121	1121
query58	274	275	264	264
query59	2627	2768	2582	2582
query60	347	375	316	316
query61	131	124	122	122
query62	810	719	651	651
query63	231	188	192	188
query64	4297	1021	732	732
query65	4325	4270	4209	4209
query66	1131	406	319	319
query67	15474	15285	15059	15059
query68	8232	903	569	569
query69	465	330	270	270
query70	1241	1106	1031	1031
query71	496	337	306	306
query72	5380	4678	4615	4615
query73	705	575	349	349
query74	9190	9041	8917	8917
query75	3881	3082	2626	2626
query76	3760	1134	724	724
query77	782	398	320	320
query78	9649	9884	8863	8863
query79	2164	833	596	596
query80	595	542	472	472
query81	477	265	224	224
query82	412	137	105	105
query83	251	250	227	227
query84	243	101	78	78
query85	796	372	337	337
query86	362	315	308	308
query87	4314	4277	4185	4185
query88	3170	2166	2158	2158
query89	396	310	294	294
query90	1933	217	242	217
query91	150	135	110	110
query92	84	67	67	67
query93	1190	971	639	639
query94	678	404	299	299
query95	381	305	307	305
query96	481	567	262	262
query97	2644	2661	2556	2556
query98	241	219	203	203
query99	1397	1382	1306	1306
Total cold run time: 272705 ms
Total hot run time: 185049 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.79 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0cdad77601a077fb50dcc202bb080e76dd453e16, data reload: false

query1	0.04	0.04	0.04
query2	0.09	0.04	0.04
query3	0.24	0.07	0.07
query4	1.62	0.11	0.11
query5	0.43	0.41	0.41
query6	1.18	0.63	0.65
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.61	0.52	0.51
query10	0.58	0.59	0.57
query11	0.16	0.11	0.11
query12	0.16	0.11	0.11
query13	0.63	0.61	0.61
query14	0.79	0.83	0.85
query15	0.88	0.85	0.87
query16	0.39	0.41	0.39
query17	1.04	1.06	1.04
query18	0.22	0.20	0.19
query19	2.03	1.83	1.88
query20	0.01	0.01	0.01
query21	15.39	0.90	0.56
query22	0.76	1.22	0.81
query23	14.85	1.37	0.65
query24	6.73	1.16	0.86
query25	0.50	0.19	0.10
query26	0.61	0.15	0.13
query27	0.07	0.05	0.06
query28	10.45	0.94	0.43
query29	12.56	3.93	3.27
query30	3.11	3.12	3.03
query31	2.82	0.57	0.38
query32	3.25	0.54	0.46
query33	3.18	3.05	3.18
query34	16.11	5.45	4.86
query35	4.98	4.92	5.01
query36	0.69	0.50	0.51
query37	0.09	0.06	0.06
query38	0.06	0.04	0.04
query39	0.04	0.02	0.03
query40	0.17	0.15	0.14
query41	0.09	0.03	0.02
query42	0.04	0.02	0.03
query43	0.04	0.03	0.04
Total cold run time: 107.76 s
Total hot run time: 32.79 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 80.46% (70/87) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.04% (16634/28176)
Line Coverage 47.92% (150902/314923)
Region Coverage 36.73% (112972/307585)
Branch Coverage 39.68% (50186/126485)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 83.91% (73/87) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.73% (22602/27653)
Line Coverage 74.38% (234249/314930)
Region Coverage 61.70% (194866/315846)
Branch Coverage 65.79% (84229/128031)

1 similar comment
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 83.91% (73/87) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.73% (22602/27653)
Line Coverage 74.38% (234249/314930)
Region Coverage 61.70% (194866/315846)
Branch Coverage 65.79% (84229/128031)

Copy link
Member

@eldenmoon eldenmoon left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 13, 2025
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@csun5285 csun5285 left a comment

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 eadb1e6 into apache:master Aug 14, 2025
29 of 30 checks passed
amorynan pushed a commit to amorynan/doris that referenced this pull request Aug 15, 2025
This pr mainly solves the problem when we insert top-level nested array
data into variant columnIssue Number:
like :
```
mysql> insert into sv1 values (1, '[{"a": 1, "c": 1.1}, {"b": "1"}]');
we maintain the association information between Nested in array , in this case , we will keep same offset at a,b,c ,

mysql> select * from sv1;
+------+----------------------------------------------+
| k    | v                                            |
+------+----------------------------------------------+
|    1 | {"a":[1,null],"b":[null,"1"],"c":[1.1,null]} |
+------+----------------------------------------------+
```
but in top array we just do flatten array not fill the null value to
maintain the association information between Nested in array
like:
```
mysql> insert into sv1 values (16, '[{"a": 1, "b": 1}, {"b": 2}, {"b": 3}]');
Query OK, 1 row affected (0.15 sec)
{'label':'label_4b3ede8b449a4d9a_b55fdeebe13b741c', 'status':'VISIBLE', 'txnId':'6031'}

mysql> select v from sv1 where k=16;
+-----------------------+
| v                     |
+-----------------------+
| {"a":[1],"b":[1,2,3]} |
+-----------------------+
1 row in set (0.19 sec)
```
amorynan pushed a commit to amorynan/doris that referenced this pull request Aug 16, 2025
This pr mainly solves the problem when we insert top-level nested array
data into variant columnIssue Number:
like :
```
mysql> insert into sv1 values (1, '[{"a": 1, "c": 1.1}, {"b": "1"}]');
we maintain the association information between Nested in array , in this case , we will keep same offset at a,b,c ,

mysql> select * from sv1;
+------+----------------------------------------------+
| k    | v                                            |
+------+----------------------------------------------+
|    1 | {"a":[1,null],"b":[null,"1"],"c":[1.1,null]} |
+------+----------------------------------------------+
```
but in top array we just do flatten array not fill the null value to
maintain the association information between Nested in array
like:
```
mysql> insert into sv1 values (16, '[{"a": 1, "b": 1}, {"b": 2}, {"b": 3}]');
Query OK, 1 row affected (0.15 sec)
{'label':'label_4b3ede8b449a4d9a_b55fdeebe13b741c', 'status':'VISIBLE', 'txnId':'6031'}

mysql> select v from sv1 where k=16;
+-----------------------+
| v                     |
+-----------------------+
| {"a":[1],"b":[1,2,3]} |
+-----------------------+
1 row in set (0.19 sec)
```
dataroaring pushed a commit that referenced this pull request Aug 18, 2025
### What problem does this PR solve?
backport : #54396
This pr mainly solves the problem when we insert top-level nested array
data into variant columnIssue Number:
like : 
```
mysql> insert into sv1 values (1, '[{"a": 1, "c": 1.1}, {"b": "1"}]');
```
we maintain the association information between Nested in array , in
this case , we will keep same offset at a,b,c ,
```
mysql> select * from sv1;
+------+----------------------------------------------+
| k    | v                                            |
+------+----------------------------------------------+
|    1 | {"a":[1,null],"b":[null,"1"],"c":[1.1,null]} |
+------+----------------------------------------------+
```
but in top array we just do flatten array not fill the null value to
maintain the association information between Nested in array
like: 
```
mysql> insert into sv1 values (16, '[{"a": 1, "b": 1}, {"b": 2}, {"b": 3}]');
Query OK, 1 row affected (0.15 sec)
{'label':'label_4b3ede8b449a4d9a_b55fdeebe13b741c', 'status':'VISIBLE', 'txnId':'6031'}

mysql> select v from sv1 where k=16;
+-----------------------+
| v                     |
+-----------------------+
| {"a":[1],"b":[1,2,3]} |
+-----------------------+
1 row in set (0.19 sec)
```


close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
morrySnow pushed a commit that referenced this pull request Aug 19, 2025
@gavinchou gavinchou mentioned this pull request Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.0.8-merged dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Comments